home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_559 / apig / apiglib_v11.lzh / apig.doc < prev    next >
Text File  |  1991-09-28  |  135KB  |  3,657 lines

  1.  
  2.                 ARexx Programmers Intuition & Graphics Library
  3.                           ( version 1.1  09/21/91 )
  4.                               (apig.library)
  5.  
  6.  
  7.   This program is in the public domain, it may be freely distributed 
  8.   and copied without restriction.
  9.  
  10.             Ronnie E. Kelly
  11.           
  12.  
  13.                 ARexx Programmers Intuition & Graphics Library
  14.                           ( version 1.1  09/21/91 )
  15.  
  16.  
  17.  
  18.    This library provides programmers with a means to access most of the
  19.    Intuition/Graphic library functions from ARexx.  The library functions 
  20.    allow you to specify most of the parameters used in the underlying
  21.    data structures of the Intuition/Graphic routines. Using the parameters 
  22.    you specify the APIG library builds an instance of the data structure 
  23.    and passes a pointer to it back to you.  Hopefully you will be able to
  24.    create more custom looking interface for your ARexx applications.
  25.    
  26.    The APIG library, for the most part, simply converts the ARexx string 
  27.    parameters to the appropriate form the Intuition/Graphic functions 
  28.    expects and then makes a call directly to the corresponding Intuition/
  29.    Graphic library function.  Few assumptions have been made about how 
  30.    you will use these functions, therefore this library does very little 
  31.    validating of the inputs you supply.
  32.    
  33.    
  34.    The library supports the following structures:
  35.    
  36.        Menus, MenuItems, SubItems
  37.        Requesters
  38.        Boolean, String, and Proportional gadgets
  39.        Borders
  40.        IntuiText
  41.        Arrays of short (16-bit) integers
  42.        Layers 
  43.        Images  ( via iff.library )
  44.  
  45.   APIG uses Christian Weber's iff.library for IFF support, you will need
  46.   the iff.library (version 18) if you plan to use any of the IFF functions.
  47.  
  48.   If you are not familiar with the Intuition/Graphic library functions or
  49.   the data structures used by these functions, then I would strongly 
  50.   recommend obtaining a copy of the latest revision of the RKM manual 
  51.   (Autodocs & Includes) and/or the Intuition Reference manual.
  52.  
  53.  
  54.  
  55.                 ARexx Programmers Intuition & Graphics Library
  56.                           ( version 1.1  09/21/91 )
  57.  
  58.  
  59.   Using The Library:
  60.  
  61.  
  62.   Like all libraries the APIG library must first be placed in your
  63.   'LIBS:' directory, the iff.library should be placed in 'LIBS:' as 
  64.   well.
  65.   
  66.   
  67.   Before calling any of the APIG library functions you must add the 
  68.   APIG library to ARexx's external library function list.  To do this
  69.   include the following statement at the beginning of your ARexx program:
  70.  
  71.            call addlib("apig.library",0,-30,0)
  72.       
  73.   You do not need to do this for the iff.library, APIG will open/close
  74.   the iff.library when needed.  APIG does not have a 'color requester' or
  75.   a 'filerequester' function and I have no plans of adding them.  However
  76.   you can still use WGL's rexxarplib.library or whatever, if you want.
  77.   In the case of rexxarplib.library, their are a couple of function 
  78.   name conflicts (OpenScreen and OpenWindow).  You can resolve these as
  79.   prescribed in the ARexx manual by using the ARexx RemLib() function.
  80.   ie. If you are gonna start calling functions in rexxarplib.library
  81.   you may want to do:
  82.  
  83.        call remlib('apig.library')
  84.  
  85.        removing apig.library from the external function list, then be sure
  86.        to add it back on when you go to call an APIG library function.
  87.        (you really only need to do the remlib() if the function you are 
  88.         calling conflicts with some other library function name)
  89.   
  90.   
  91.  
  92.   You are now ready to use to the APIG library functions.
  93.   
  94.   
  95.   
  96.   
  97.   
  98.  
  99.                 ARexx Programmers Intuition & Graphics Library
  100.                           ( version 1.1  09/21/91 )
  101.  
  102.  
  103.   
  104.   Most of the functions have the same name as their Amiga Intuition/Graphics
  105.   library counterpart and are used the same way.  The number of parameters,
  106.   their order, and their type are the same as described in the RKM manual.
  107.   
  108.   eg.
  109.       The Intuition function DrawImage() expects a pointer to a RastPort, 
  110.       a pointer to an Image structure, and X & Y coordinates.
  111.       The APIG library function DrawImage() expects the same parameters,
  112.       the same type, and in the same order as the Intuition function.
  113.       Unless otherwise noted in the function descriptions below this will 
  114.       always be the rule.
  115.  
  116.  All function parameters must be specified and must be of the type expected
  117.  by the function.  If you specify more parameters than the function expects
  118.  the superflous parameters will be ignored.  If you specify fewer parameters
  119.  than the function expects, then the function will return with a ARexx
  120.  error code of 17, your ARexx program will terminate as well.
  121.  
  122.  BIG WARNING !!!  Parameters specified in the wrong order or wrong type
  123.  will more than likely bring on the GURU.
  124.  
  125.  If your ARexx program terminates with windows/screens still open it may
  126.  still be possible to close the windows/screens and recover the memory
  127.  used by them, see the OPENWINDOW() function description on how this is
  128.  done.
  129.       
  130.  The APIG functions always return a result to you, even if the Intuition,
  131.  Graphic, or Layer function returns no result.  If the Amiga library
  132.  function returns a result, then the result returned is that result.
  133.  
  134.  If the Amiga library function does not return a result, then the value
  135.  returned to you is either 1 or 0.  A return value of 1 indicates
  136.  that the APIG library made the call to the Amiga library function.
  137.  A return value of 0 indicates that the Amiga library function was not
  138.  called (possibly due to error).
  139.  
  140.  Their are several functions in the library for building instances of the
  141.  various Amiga graphic structures.  Use these functions to create the 
  142.  pointers (ARexx 'hex' strings) needed by the other functions.  Functions
  143.  which return pointers, either return a valid (valued) hex string or they
  144.  return NULL (ie. '0000 0000'x).  You should verify that you do indeed 
  145.  have a valid (non-null) pointer before using it.  The library checks 
  146.  for null pointers and will not perform a function if it expects the 
  147.  pointer argument(s) to be non-null.  Valid pointers are the actual
  148.  address of the data structure created.  All fields within the structure 
  149.  are available for your use (via GETVALUE/SETVALUE), field offsets are 
  150.  as defined in the RKM's for 1.3.  Their is only ONE exception, the field
  151.  ExtData in the Window structure has been appropriated by the APIG library.
  152.  Do not modify in any way the ExtData field in the Window structure.
  153.  
  154.                 ARexx Programmers Intuition & Graphics Library
  155.                           ( version 1.1  09/21/91 )
  156.  
  157.  
  158.  
  159.  Many of the graphic data structures contain 'flags' which describe
  160.  certain characteristics of the structure.  The APIG library uses the
  161.  same flag values as defined in the RKM manuals, without exception.
  162.  (see SET_APIG_GLOBALS function description below)
  163.  
  164.  Where multiple flag values are required (needed) you can simply sum 
  165.  all the values together.  The flag values you specify are not 'touched'
  166.  and get passed directly to the Amiga library function/data structure. 
  167.  Their are very few defaults so be sure to specify all that you need.
  168.  
  169.  The APIG library should return all memory allocated to the system 
  170.  memory pool.  Version 1.1 of APIG allocates memory for the structures
  171.  differently than in version 0.5.
  172.  
  173.  IN VERSION 0.5 OF APIG, GADGETS, INTUITEXT, REQUESTERS, MENUS AND SUCH 
  174.  WERE ALLOCATED TO A SPECIFIC WINDOW AND EXISTED UNTIL THE WINDOW WAS
  175.  CLOSED.  THEIR WERE NO FUNCTIONS IN VERSION 0.5 FOR FREEING THE MEMORY
  176.  USED BY THESE STRUCTURES, SINCE ALL MEMORY WAS 'OWNED' BY THE WINDOW.
  177.  
  178.  IN VERSION 1.1 OF APIG, GADGETS, INTUITEXT, REQUESTERS, MENUS AND SUCH
  179.  CAN NOW BE INDEPENDENTLY FREED PRIOR TO CLOSING THE WINDOW.  MENUS NO
  180.  LONGER NEED BE RE-CREATED EACH TIME A WINDOW IS CLOSED AND THEN RE-OPENED.
  181.  
  182.  IN FACT MOST OF THE DATA STRUCTURES CAN BE ALLOCATED INDEPENDENTLY AND,
  183.  CAN BE 'OWNERS' OF OTHER STRUCTURES.  STRUCTURES WHICH ARE ALLOCATED TO 
  184.  (OWNED BY) A WINDOW ARE FREED WHEN THE WINDOW CLOSES, SIMILARLY STRUCTURES
  185.  WHICH ARE 'OWNED' BY OTHER STRUCTURES ARE FREED WHEN THEIR 'OWNER' IS FREED.
  186.  
  187.  THE USE OF AN 'OWNER' SIMPLY ALLOWS YOU TO BIND THE EXISTENCE OF THE 
  188.  STRUCTURE TO THE LIFE OF ITS OWNER. WHEN THE OWNER IS FREED, EVERYTHING
  189.  IT OWNS IS ALSO FREED.  THUS IF YOU WANTED, YOU COULD MAKE A WINDOW THE 
  190.  OWNER OF EVERYTHING YOU ALLOCATE, WHEN THE WINDOW IS CLOSED ALL MEMORY
  191.  ALLOCATED, GADGETS, INTUITEXT, REQUESTERS, BORDERS, ETC. WILL BE FREED
  192.  AS WELL.  THIS ALSO ALLOWS YOU TO HAVE MULTIPLE WINDOWS OWNING WHAT THEY
  193.  NEED AND SHARING INDEPENDENT STRUCTURES, WHICH REMAIN VALID AFTER THE
  194.  WINDOW IS CLOSED.
  195.  
  196.  You should find that this relieves you of having to keep track of all
  197.  the structures you have allocated then having to explicity free each
  198.  one.  By logical (planned) allocation of structures to an 'owner' you
  199.  can reduce the amount of memory being used by structures that are no
  200.  longer needed.
  201.  
  202.                 ARexx Programmers Intuition & Graphics Library
  203.                           ( version 1.1  09/21/91 )
  204.  
  205.  
  206.       eg. creating a requester
  207.  
  208.       req  = makerequester(0, ... )         /* 0 = independent       */
  209.  
  210.       gad1 = makeboolgadget( req,...,req )  /* req owns this gadget  */
  211.                                             /* and link it to req    */
  212.  
  213.       gad2 = makestrgadget( req,...,req )   /* req owns this gadget  */
  214.                                             /* and link it to req    */
  215.  
  216.       gad3 = makepropgadget( req,...,req )  /* req owns this gadget  */
  217.                                             /* and link it to req    */
  218.  
  219.       gad4 = makeboolgadget( 0,...,gad3 )   /* 0 = independent       */
  220.  
  221.       txt1 = makeitext( req,...,req  )      /* req owns this itext   */
  222.                                             /* and link it to req    */
  223.  
  224.       txt2 = makeitext( req,...,txt1 )      /* req owns this itext   */
  225.                                             /* and link it to txt1   */
  226.                                             /* which is the same as  */
  227.                                             /* linking it to req     */
  228.  
  229.       txt3 = makeitext( req,...,txt2 )      /* req owns this itext   */
  230.                                             /* and link it to txt2   */
  231.                                             /* which is the same as  */
  232.                                             /* linking it to req     */
  233.           
  234.       (linking here means the gadget/itext is added to the
  235.        gadget/itext list in the structure, see function 
  236.        descriptions below)
  237.   
  238.       The requester created is independent of any other structure,
  239.       and must be explictly freed. It need not be re-created each
  240.       time and can be put in any window (via REQUEST()) you happen to 
  241.       open.  When done with the window, the window can close, but the 
  242.       requester will still be useable.
  243.  
  244.       Now when the requester is freed the gadgets, gad1, gad2, and gad3
  245.       will also be freed, the intuitext, txt1, txt2, txt3 will be freed
  246.       as well.
  247.  
  248.       Gadget gad4 will not be freed, it is independent, even though
  249.       it has been linked to gadget gad3. This is unsafe,so dont do it.
  250.  
  251.       With one single 'free' call all the structures needed by the 
  252.       requester are freed with it.  The gadgets and intuitext owned
  253.       by the requester cannot be independently freed. APIG will not be
  254.       able to find the gadgets and intuitext owned by the requester on
  255.       the lists APIG maintains of allocated structures.  APIG could
  256.       find them but it would have to search each and every memory BLOCK
  257.       that it allocated.  In the above situation APIG would only see
  258.       two STRUCTURE allocations (req and gad4) but it wont search the
  259.       memory BLOCKS owned by them.
  260.  
  261.                 ARexx Programmers Intuition & Graphics Library
  262.                           ( version 1.1  09/21/91 )
  263.  
  264.             
  265.       Now their are some restrictions on what can be an owner and what
  266.       can be owned, they are simply
  267.  
  268.           1).   A WINDOW is ALWAYS independent and can own ANYTHING,
  269.                 except a screen.  (a window can never be 'owned')
  270.  
  271.           2).   A SCREEN is ALWAYS independent and can own ANYTHING,
  272.                 except a window.  (a screen can never be 'owned')
  273.  
  274.           3).   GADGETS, INTUITEXT, REQUESTERS, and BORDERS can all be
  275.                 owners and all can be owned. However they cannot
  276.                 own a menu/menuitem/subitem. A border can own a
  277.                 requester, though it makes more sense for a requester
  278.                 to own a border.
  279.    
  280.           4).   MENU structures can own ANYTHING that can be owned, 
  281.                 including, gadgets, intuitext, requesters, borders, etc. 
  282.                 Menus can only be owned by another menu, a window, or
  283.                 a screen.
  284.  
  285.           5).   MENUITEMS and SUBITEMS cannot be owners, and can only
  286.                 be owned by a menu, a window, or screen.
  287.          
  288.           6).   BITMAPS, RASTPORTS, and IMAGES, are the same as (3) above.
  289.                 An image can own Intuitext, Gadget, etc. but cannot own
  290.                 a menu/menuitem/subitem.
  291.  
  292.      Basically ownership of a menu/menuitems are restricted to windows,
  293.      screens, and other independent menus.  
  294.  
  295.      Only 'independent' structures can be owners, eg. a gadget owned by a
  296.      window cannot be an 'owner'.  'Independent' structures must be 
  297.      explictly freed.
  298.  
  299.      When allocating a structure to an 'owner', if APIG is unable to find
  300.      the 'owner' it will allocate the structure as an independent structure
  301.      and place it in the appropriate list.
  302.  
  303.       eg. lets say you load an IFF pic as follows
  304.  
  305.         pic = loadiff("mypic",itsowner)
  306.  
  307.         if 'itsowner' is not found by APIG, then pic will be allocated as
  308.         an independent structure and placed in the bitmap list.  You will
  309.         then need to explictly free it with FREEBITMAP(pic).
  310.  
  311.       eg.        
  312.         itext = makeitext(itsowner,...)  /* 'itsowner' not found */
  313.  
  314.         The IntuiText structure would be placed in the intuitext list, 
  315.         and you would then need to use FREEITEXT(itext).
  316.  
  317.                 ARexx Programmers Intuition & Graphics Library
  318.                           ( version 1.1 09/21/91 )
  319.  
  320.  
  321.  
  322.  
  323.   APIG Library Function Descriptions:
  324.  
  325. The following functions are provided to allow building and managing of the 
  326. basic data structures used by the Intuition, Graphic, and Layer functions.
  327.  
  328.                      
  329.  
  330.  
  331. <>  CONVERTRAWKEY(keycode,qualifier,keymap)
  332.  
  333.       This function is used to convert a 'raw' keycode value into
  334.       its equivalent ascii character string.
  335.       
  336.       Inputs:
  337.  
  338.          keycode   - numeric, the raw keycode value to be converted
  339.          
  340.          qualifier - numeric, the value of any key qualifiers such as
  341.                      LSHIFT,LAMIGA, etc.
  342.                      
  343.          keymap    - pointer to a keymap structure
  344.                      This value is currently ignored, but must be 
  345.                      present.  In a future release keymap support
  346.                      maybe provided, for now code this as zero.
  347.                      
  348.          Returns   - the ascii character string for the specified keycode
  349.                      and key qualifier.
  350.                      
  351.                      
  352. ------------------------------------------------ 
  353.  
  354.  
  355. <>  BMDEPTH(bm)
  356. <>  BMHEIGHT(bm)
  357. <>  BMWIDTH(bm)
  358.  
  359.       These functions return the depth, height, and width values for 
  360.       the bitmap.  These values are useful when doing blits.
  361.       
  362.       Inputs:
  363.       
  364.          bm - must be a pointer to a bitmap structure
  365.          
  366.       Returns: - depth, height, or width
  367.          
  368.  
  369. ------------------------------------------------ 
  370.  
  371.             
  372. <>  IMGDEPTH(image)
  373. <>  IMGHEIGHT(image)
  374. <>  IMGWIDTH(image)
  375.  
  376.       These functions return the depth, height, and width values for 
  377.       the image.  These values are useful when doing blits.
  378.       
  379.       Inputs:
  380.       
  381.          image - must be a pointer to an image structure
  382.  
  383.       Returns: - depth, height, or width
  384.       
  385.                      
  386. ------------------------------------------------ 
  387.  
  388.  
  389. <>  FREEAREA(window)
  390.  
  391.       This function releases the memory allocated for the areafill/flood
  392.       functions.
  393.       
  394.       Inputs:
  395.       
  396.           window  - pointer to a window opened with OPENWINDOW().
  397.                     A prior call to MAKEAREA() should have been made 
  398.                     to the same window.
  399.        
  400.       Returns:    - always returns 1
  401.                      
  402.  
  403. ------------------------------------------------ 
  404.  
  405.             
  406. <>  FREEBITMAP(pointertobitmap)
  407. <>  FREEIMAGE(pointertoimage)
  408. <>  FREERASTPORT(pointertorastport)
  409. <>  FREEBIRASIM(pointer)
  410. <>  FREEMENU(menustrippointer)
  411. <>  FREEITEXT(intuitextpointer)
  412. <>  FREETHIS(pointer to any independent structure)
  413.  
  414.       These functions return the memory allocated for the bitmap, image
  415.       rasterport, menustrip, intuitext, or whatever to the system.
  416.       
  417.       The APIG library maintains separate list for bitmaps, images,
  418.       rastports, bitplane, and menustrip memory allocations.
  419.       Using FREEBITMAP, FREEIMAGE, FREERASTPORT, FREEMENU, FREEITEXT will 
  420.       cause only the appropriate list to be searched, hopefully to 
  421.       save search time.
  422.       
  423.       FREEBIRASIM, will check only the bitmap, rastport, and image lists,
  424.       until it finds the allocated structure or fails to find it.
  425.       
  426.       FREETHIS will check ALL list.
  427.  
  428.       Note independent requesters, gadgets, and borders are freed with 
  429.       the FREETHIS() function (after awhile this does get a bit redundant).
  430.       
  431.       
  432.       Inputs:
  433.       
  434.          pointer - must be a pointer to an independent bitmap, image, 
  435.                    rastport or whatever.  Pointer must be obtained from 
  436.                    the corresponding make function (MAKEBITMAP(), etc.)
  437.          
  438.       Returns:   - returns positive non-zero value if successful, the
  439.                    value will vary and is the number of 'things' that
  440.                    were 'owned' by the object freed.
  441.  
  442.                    eg. FREEBITMAP() typically may return a value of 12,
  443.                    the 12 represents the bitplane allocations and any
  444.                    other allocations (eg. CMAP chunks) that were owned
  445.                    by the bitmap.
  446.  
  447.                  - Returns zero if nothing was freed, ie. did not find
  448.                    the structure.
  449.             
  450.                      
  451. ------------------------------------------------ 
  452.  
  453.  
  454. <>  GADSELECTED( gadgetptr )
  455.  
  456.       This function returns TRUE/FALSE depending on the state of 
  457.       the gadget.
  458.       
  459.       Inputs:
  460.  
  461.           gadgetptr  - pointer to a gadget
  462.           
  463.      Returns:        - returns 1 if the gadget state is SELECTED,
  464.                        otherwise returns 0.
  465.  
  466. ------------------------------------------------ 
  467.  
  468.             
  469. <>  GETARRAY(arrayptr,arrayindx)
  470.       
  471.       This function allows you to retrieve the 16-bit value stored in the 
  472.       array pointed to by 'arrayptr'. 
  473.    
  474.       Inputs:
  475.    
  476.           arrayptr   - pointer to array (block of memory) as returned 
  477.                        by ARexx ALLOCMEM().
  478.        
  479.           arrayindx  - numeric, index position you wish to get
  480.  
  481.      Returns:        - returns value stored in array position 'arrayindx'.
  482.                      
  483.      Also See: SETX(), SETY(), GETX(), GETY(), SETARRAY()
  484.  
  485.  
  486. ------------------------------------------------ 
  487.  
  488.  
  489. <>  GETGADPTR( window,gadgetid )
  490.  
  491.       This function searches the window's gadget list for a gadget with 
  492.       GadgetID equal to 'gadgetid' and returns a pointer to the gadget.
  493.       
  494.       Inputs:
  495.  
  496.           window     - pointer to window opened with OPENWINDOW().
  497.           
  498.           gadgetid   - numeric, gadgetid 
  499.           
  500.      Returns:        - pointer (ARexx hex-string) to gadget.
  501.  
  502.   
  503. ------------------------------------------------ 
  504.  
  505.  
  506. <>  GETIDCMP(window)
  507.       
  508.       This function allows you to retrieve the current value of IDCMPFlags
  509.       for the window.
  510.       
  511.       Inputs:
  512.       
  513.           window     - pointer to window as returned by OPENWINDOW().
  514.           
  515.      Returns:        - windows IDCMPFlags value
  516.                      
  517. ------------------------------------------------ 
  518.  
  519.  
  520. <>  GETLAYERINFO(layer)
  521.       
  522.       This function allows you to retrieve the pointer to the layers 
  523.       layer_info structure.
  524.       
  525.       Inputs:
  526.       
  527.           layer      - pointer to layer
  528.           
  529.      Returns:        - pointer to layer info for the layer
  530.                      
  531. ------------------------------------------------ 
  532.  
  533.  
  534. <>  GETLAYERRASTPORT(layer)
  535.       
  536.       This function allows you to retrieve the pointer to the layers 
  537.       RastPort. You will need the rastport pointer for the layer when 
  538.       using the drawing functions.
  539.       
  540.       Inputs:
  541.       
  542.           layer      - pointer to layer as returned by CREATEUPFRONTLAYER()
  543.                        or CREATEBEHINDLAYER() functions.
  544.           
  545.      Returns:        - pointer to rastport for the layer
  546.  
  547.                 ARexx Programmers Intuition & Graphics Library
  548.                           ( version 1.1 09/21/91 )
  549.  
  550. ------------------------------------------------ 
  551.  
  552.  
  553. <>  GETRPBITMAP(rp)
  554.       
  555.       This function allows you to retrieve the pointer to the BitMap of
  556.       the RastPort.
  557.       
  558.       Inputs:
  559.       
  560.           rp         - pointer to RastPort structure.
  561.           
  562.      Returns:        - pointer to bitmap for the rastport
  563.  
  564.                      
  565. ------------------------------------------------ 
  566.  
  567.  
  568. <>  GETSCREENBITMAP(screen)
  569.  
  570.       This function allows you to retrieve the pointer to the BitMap of
  571.       the screen.
  572.       
  573.       Inputs:
  574.       
  575.           screen     - pointer to screen, returned by OPENSCREEN().
  576.           
  577.      Returns:        - pointer to bitmap for the rastport
  578.  
  579.  
  580. ------------------------------------------------ 
  581.  
  582.  
  583. <>  GETSCREENRASTPORT(screen)
  584.  
  585.       This function allows you to retrieve the pointer to the RastPort of
  586.       the screen.
  587.       
  588.       Inputs:
  589.       
  590.           screen     - pointer to screen, returned by OPENSCREEN().
  591.           
  592.      Returns:        - pointer to rastport for the screen
  593.  
  594.  
  595. ------------------------------------------------ 
  596.  
  597.  
  598. <>  GETSTRGAD( window,gadgetid )
  599.  
  600.       This function retrieves the value of the string gadget.
  601.       
  602.       Inputs:
  603.  
  604.           window     - pointer to window opened with OPENWINDOW().
  605.           
  606.           gadgetid   - numeric, gadgetid of the string gadget
  607.           
  608.      Returns:        - string contents of the string gadget
  609.  
  610.                 ARexx Programmers Intuition & Graphics Library
  611.                           ( version 1.1 09/21/91 )
  612.  
  613. ------------------------------------------------ 
  614.  
  615. <>  GETVALUE(ptr,offset,size,type)
  616.  
  617.       This function allows you to retreive the value of any parameter in
  618.       any data structure.
  619.    
  620.       ptr    - pointer, (ARexx hex string) to any data structure, ie. window
  621.                screen, bitmap, etc.
  622.    
  623.       offset - numeric, specifies the relative position, from the beginning
  624.                of the data structure, of data value you want to retrieve.
  625.                (see RKM or include '.i' files for offsets)
  626.    
  627.       size   - numeric, specifies the size of the data value you want to
  628.                retrieve.  This value must be either 1, 2, or 4.  Any other
  629.                value will cause the function to return a NULL ('0000 0000'x).
  630.                
  631.       type   - string, either a 'N', 'P' or 'S', this specifies the type
  632.                of data you are retrieving.
  633.    
  634.                'N' specifies that you want the value returned as a numeric.
  635.                    for sizes of 1 and 2 the returned value is always as a 
  636.                    numeric.
  637.    
  638.                If the size is 4 then you can also use (in addition to 'N')
  639.                the following:
  640.    
  641.                'P' specifies that you want the value returned as a pointer.
  642.                    (ie. ARexx hex string)
  643.    
  644.                'S' specifies that you want the value returned as a string.
  645.    
  646.                    VERY IMPORTANT NOTE !!! 
  647.                    When using 'P' or 'S',  'ptr' + 'offset' must result 
  648.                    in an address which contains a pointer to something.
  649.    
  650.    
  651.                eg.  You can retrieve the window title string with:
  652.                
  653.                     title = getvalue(windowpointer,32,4,'S')
  654.                     
  655.                     say "Your Window title is" title
  656.                     
  657.                     (the title string pointer is offset 32 from the beginning
  658.                      of the window structure)
  659.                      
  660.                     
  661.                eg.  To have the window title pointer returned as a pointer:
  662.                     
  663.                     titleptr = getvalue(win,32,4,'p')
  664.                     
  665.                     say "Window Title Pointer is " d2x(c2d(titleptr))
  666.                     
  667.                     
  668.                eg.  To return the contents of a string gadget :
  669.  
  670.                     specialstringinfo = getvalue(gadgetpointer,34,4,'P')
  671.                     gadcontents = getvalue(specialstringinfo,0,4,'S')      
  672.                     say "Your gad string is" gadcontents
  673.                   
  674.                eg.  Determining if a gadget is SELECTED:
  675.   
  676.                     if bittst(d2c(getvalue(gadpointer,12,2,'N')),7) = 1 then
  677.                        say "Gadget SELECTED"
  678.                     else
  679.                        say "Gadget NOT SELECTED"
  680.  
  681.                     getvalue(gadpointer,12,2,'N') returns the gadget Flags
  682.                     d2c() converts the result to form 'nnnn'x
  683.                     bittst() test bit 7, the gad select bit.
  684.                  
  685.    
  686.    
  687.          returns -  the value you specified in the form specified.
  688.                     defaults to returning numeric if type not 'N', 'P', or 'S'
  689.                     returns NULL ('0000 0000'x) if size not 1, 2, or 4.
  690.                     (their is no way to distinguish between returning a valid
  691.                      null pointer ('P' type) and error in size/type)
  692.  
  693.                 ARexx Programmers Intuition & Graphics Library
  694.                           ( version 1.1 09/21/91 )
  695.  
  696.  
  697. ------------------------------------------------ 
  698.  
  699.  
  700. <>  GETWINDOWLAYER(window)
  701.  
  702.       This function allows you to retrieve the windows layer pointer.
  703.  
  704.       Inputs:
  705.  
  706.           window     - pointer to window as returned by OPENWINDOW().
  707.  
  708.      Returns:        - pointer to rastport for the layer
  709.  
  710.  
  711. ------------------------------------------------ 
  712.  
  713.  
  714. <>  GETWINDOWRASTPORT(window)
  715.  
  716.       This function allows you to retrieve the windows rastport pointer
  717.  
  718.       Inputs:
  719.  
  720.           window     - pointer to window as returned by OPENWINDOW().
  721.  
  722.      Returns:        - pointer to rastport for the window
  723.  
  724.  
  725. ------------------------------------------------ 
  726.  
  727.  
  728. <>  GETX(arrayptr,xindex)
  729.  
  730.       This function does the same as GETARRAY(), the difference is that
  731.       it computes the index offset value for the X-pair for you.
  732.  
  733.       eg. if arrayptr is an array of 20 XY-pairs (40 16-bit values)
  734.           then
  735.                x = getx(arrayptr,8), retrieves the value for the 8th 
  736.                    X value. 
  737.                the equivalent using GETARRAY() would be
  738.                x = getarray(arrayptr,32)
  739.  
  740.       Inputs:
  741.  
  742.           arrayptr   - pointer to array as returned by ARexx ALLOCMEM().
  743.  
  744.           xindex     - numeric, index position you wish to set   
  745.  
  746.      Returns:        - returns the value stored in array position xindex.
  747.  
  748.      Also See: SETX(), SETY(), GETY(), GETARRAY(), SETARRAY()
  749.  
  750.                 ARexx Programmers Intuition & Graphics Library
  751.                           ( version 1.1 09/21/91 )
  752.  
  753.  
  754. ------------------------------------------------ 
  755.  
  756.  
  757. <>  GETY(arrayptr,yindex)
  758.  
  759.       This function does the same as GETARRAY(), the difference is that
  760.       it computes the index offset value for the Y-pair for you.
  761.  
  762.       Inputs:
  763.  
  764.           arrayptr   - pointer to array as returned by ARexx ALLOCMEM().
  765.  
  766.           yindex     - numeric, index position you wish to retreive.
  767.  
  768.      Returns:        - returns the value stored in array position yindex.
  769.  
  770.      Also See: SETX(), SETY(), GETY(), GETARRAY(), SETARRAY()
  771.  
  772.  
  773. ------------------------------------------------ 
  774.  
  775.  
  776. <>  HORIZPOT(gadgetptr)
  777.  
  778.       This function returns the value of the horizontal component of the
  779.       pot gadget.
  780.  
  781.       Inputs:
  782.  
  783.           gadgetptr  - pointer to a proportional gadget, return from 
  784.                        MAKEPROPGADGET().
  785.  
  786.      Returns:        - returns the numeric value of HorizPot
  787.  
  788.  
  789. ------------------------------------------------ 
  790.  
  791.  
  792. <>  IFFDEPTH(pointer)
  793. <>  IFFHEIGHT(pointer)
  794. <>  IFFWIDTH(pointer)
  795.  
  796.       These functions return the various dimensions of the IFF image 
  797.       pointed to by the bitmap pointer.
  798.  
  799.       Note that BMDEPTH()/BMHEIGHT/BMWIDTH() will return the same values.
  800.       The difference is where the information is obtained, the BM... 
  801.       functions retrieve the values from the bitmap itself.  The IFF... 
  802.       functions retrieve the values from the 'BMHD' chunk that was loaded
  803.       with the IFF file.  The two sets of values should always be the
  804.       same since the 'BHMD' chunk values are used to allocate the bitmap.
  805.       (Unless, of course, the IFF was blitted into a different bitmap)
  806.  
  807.  
  808.       Inputs:
  809.  
  810.           pointer    - pointer to a IFF bitmap (returned by LOADIFF()).
  811.                        This must be the original bitmap pointer 
  812.                        (or copy of it) returned by the LOADIFF() function. 
  813.                        You cannot use a pointer returned by MAKEBITMAP() 
  814.                        into which you have blitted the IFF.  If the pointer
  815.                        was returned from MAKEBITMAP() then use BMDEPTH() etc.
  816.  
  817.       Returns:       - returns the width, height, depth of the IFF
  818.                        image.
  819.  
  820.  
  821. ------------------------------------------------ 
  822.  
  823.  
  824. <>  IFFVIEWMODE(pointer)
  825.  
  826.       This function returns the viewmodes (HAM/HIRES/LACE etc.) word 
  827.       for the IFF.
  828.  
  829.       Inputs:
  830.  
  831.           pointer    - pointer to a IFF bitmap (returned by LOADIFF()).
  832.                        This must be the original bitmap pointer 
  833.                        (or copy of it) returned by the LOADIFF() function. 
  834.                        You cannot use a pointer returned by MAKEBITMAP() 
  835.                        into which you have blitted the IFF.
  836.  
  837.       Returns:       - returns the viewmodes word
  838.  
  839.  
  840. ------------------------------------------------ 
  841.  
  842.  
  843. <>  IFFCOLORS(pointer)
  844.  
  845.        This function returns the number of colors used in the IFF
  846.  
  847.       Inputs:
  848.  
  849.           pointer    - pointer to a IFF bitmap (returned by LOADIFF()).
  850.                        This must be the original bitmap pointer 
  851.                        (or copy of it) returned by the LOADIFF() function. 
  852.                        You cannot use a pointer returned by MAKEBITMAP() 
  853.                        into which you have blitted the IFF.
  854.  
  855.       Returns:       - returns number of colors 
  856.  
  857.  
  858. ------------------------------------------------ 
  859.  
  860.  
  861. <>  IFFCOLORTAB(pointer)
  862.  
  863.        This function returns a pointer to the color table used by the IFF.
  864.  
  865.       Inputs:
  866.  
  867.           pointer    - pointer to a IFF bitmap (returned by LOADIFF()).
  868.                        This must be the original bitmap pointer 
  869.                        (or copy of it) returned by the LOADIFF() function. 
  870.                        You cannot use a pointer returned by MAKEBITMAP() 
  871.                        into which you have blitted the IFF.
  872.  
  873.       Returns:       - returns a pointer (ARexx string) to a color table
  874.                        (array of short integers) which specify the color
  875.                        values used in the IFF.
  876.                        returns 0 if not a pointer to IFF or if the IFF 
  877.                        does not contain a CMAP chunk.
  878.  
  879.  
  880. ------------------------------------------------ 
  881.  
  882.  
  883. <>  LOADIFF(filename,owner)
  884.  
  885.       This function uses Christian Weber's iff.library to load an IFF file.
  886.  
  887.       Inputs:
  888.  
  889.           filename   - the name of the IFF file.
  890.  
  891.  
  892.           owner      - pointer to object which will own this IFF.
  893.           
  894.                        if 0 then this will be an independent
  895.                        IFF bitmap which must be explictly freed.
  896.  
  897.                        Owner can also be ANY of the owners described
  898.                        in the MAKEBOOLGADGET description.
  899.  
  900.       Returns:       - This function returns a pointer to the bitmap 
  901.                        structure containing the IFF imagery.  Note that 
  902.                        no display of the IFF imagery is done.  To display 
  903.                        the imagery use one of the blit functions contained 
  904.                        in this library, to blit it into the bitmap/rastport 
  905.                        of your choice. When you are done using the bitmap 
  906.                        imagery you should free the memory allocated to it, 
  907.                        by calling FREEBITMAP() or FREEBIRASIM().
  908.  
  909.                      - returns null ('0000 0000'x) if load fails   
  910.  
  911.  
  912. ------------------------------------------------ 
  913.  
  914.       
  915. <>  LOADIMAGE(filename,imageptr,left,top,owner)
  916.  
  917.       This function uses Christian Weber's iff.library to load an IFF file.
  918.       The difference between this function and LOADIFF() is that this 
  919.       function returns a pointer to an Image structure.  The bitmap planes 
  920.       of the IFF file are re-arranged to conform with the layout required 
  921.       for ImageData.
  922.  
  923.       Inputs:
  924.  
  925.           filename   - the name of the IFF file.
  926.  
  927.           imageptr   - pointer to image structure
  928.                        if this is non-null the loaded image
  929.                        will be linked to this image.
  930.  
  931.           left       - numeric, the value to set the LeftEdge of
  932.                        the image structure
  933.  
  934.           top        - numeric, the value to set the TopEdge of
  935.                        the image structure
  936.  
  937.           owner      - pointer to object which will own this Image.
  938.           
  939.                        if 0 then this will be an independent
  940.                        image which must be explictly freed.
  941.  
  942.                        Owner can also be ANY of the owners described
  943.                        in the MAKEBOOLGADGET description.
  944.  
  945.       Returns:       - This function returns a pointer to an Image structure
  946.                        containing the IFF imagery.  Note that no display of
  947.                        IFF imagery is done.  To display the imagery you use
  948.                        the DRAWIMAGE() function.  The returned value can 
  949.                        also be used in defining imagery for gadgets.
  950.                        When you are done using the Image you should free 
  951.                        the memory allocated to it, by calling FREEIMAGE()
  952.                        or FREEBIRASIM().
  953.  
  954.                      - returns null ('0000 0000'x) if load fails   
  955.  
  956.  
  957. ------------------------------------------------ 
  958.  
  959.       
  960. <>  MAKEAREA(window,xsize,ysize,maxvectors)
  961.  
  962.       Initializes the windows rastport for use with the Area-Fill-Flood
  963.       functions.  This function consumes a large chuck of your CHIP memory
  964.       you should get your area fill operations done as quickly as possible
  965.       then free up the memory with the function FREEAREA().
  966.       This function must be called before you do any areafill/floodfills.
  967.       The memory remains allocated until FREEAREA() is called.
  968.  
  969.  
  970.       Inputs:
  971.  
  972.           window     - pointer to window opened with OPENWINDOW().
  973.  
  974.           xsize      - numeric, specifies the width of the largest area you
  975.                        plan to fill.
  976.  
  977.           ysize      - numeric, specifies the height of the larges area you
  978.                        plan to fill.
  979.  
  980.                        (Recommended that xsize,ysize be the same size
  981.                         as the rasport you are drawing into.)
  982.  
  983.           maxvectors - numeric, specifies the number of vertices (points)
  984.                        you expect to draw.  This parameter is NOT ignored
  985.                        and must be non-zero.
  986.  
  987.      Returns:        - always returns 1, this simply indicates that the
  988.                        library made the call to the Intuition/Graphics
  989.                        library function.
  990.  
  991.  
  992. ------------------------------------------------ 
  993.  
  994.  
  995. <>  MAKEBITMAP(width,height,depth,owner)
  996.  
  997.       This function allocates and builds a bitmap structure and returns
  998.       a pointer to it.  The purpose for this is to allow you to build 
  999.       off-screen bitmaps then blit them on screen when ready.
  1000.  
  1001.       Inputs:
  1002.  
  1003.           width      - width of the bitmap
  1004.  
  1005.           height     - height of the bitmap
  1006.  
  1007.           depth      - depth, number of bit planes, of the bitmap
  1008.  
  1009.           owner      - pointer to object which will own this bitmap.
  1010.                        code as zero if independent bitmap, in which
  1011.                        case it must be explicitly freed, with FREEBITMAP
  1012.                        or FREEBIRASIM.
  1013.  
  1014.                      - pointer  Any other independent owner see 
  1015.                        description of owners under MAKEBOOLGAGET.  
  1016.                        Their are no restrictions on who/what can 
  1017.                        own a bitmap.
  1018.  
  1019.       Returns:       - pointer to bitmap structure
  1020.                      - returns null ('0000 0000'x) if call fails
  1021.  
  1022.                 ARexx Programmers Intuition & Graphics Library
  1023.                           ( version 1.1 09/21/91 )
  1024.  
  1025.  
  1026. ------------------------------------------------ 
  1027.  
  1028.  
  1029. <>  MAKEBOOLGADGET( owner,left,top,width,hgt,flags,activation,
  1030.                                itext,bpen,render,select,gadid,linkto )
  1031.  
  1032.       Allocates and builds a boolean gadget structure.
  1033.  
  1034.       Inputs:
  1035.  
  1036.           owner      - pointer to object which will own the memory
  1037.                        allocated for this gadgets structure.
  1038.  
  1039.                        For gadgets the owner can be any one of the 
  1040.                        following:
  1041.  
  1042.                        0).  0 - independent structure
  1043.                             If the 'owner' is coded as zero then the
  1044.                             gadget created can be used as an owner 
  1045.                             for other structures. 
  1046.                       
  1047.                        1).  pointer to window
  1048.                             The gadget will be owned by this window,
  1049.                             the gadget memory will be freed when 
  1050.                             the window is closed. NOTE THE GADGET IS
  1051.                             NOT PLACED IN THE WINDOWS GADGET LIST.
  1052.  
  1053.                        2).  pointer to screen
  1054.                             The gadget will be owned by this screen,
  1055.                             the gadget memory will be freed when 
  1056.                             the screen is closed.
  1057.  
  1058.                        3).  pointer to requester
  1059.                             The gadget will be owned by this requester,
  1060.                             the gadget memory will be freed when the 
  1061.                             requester is freed. NOTE THE GADGET IS
  1062.                             NOT PLACED IN THE REQUESTERS GADGET LIST.
  1063.  
  1064.                        4).  pointer to intuitext 
  1065.                             The gadget will be owned by this intuitext,
  1066.                             the gadget memory will be freed when the
  1067.                             intuitext is freed.
  1068.  
  1069.                        5).  pointer to gadget 
  1070.                             the created gadget will be owned by the 
  1071.                             specified gadget, the created gadget memory
  1072.                             will be freed when the specified owner
  1073.                             gadget is freed. NOTE THE GADGETS ARE NOT
  1074.                             LINKED.
  1075.  
  1076.                        6).  pointer to border 
  1077.                             The gadget will be owned by this border,
  1078.                             the gadget memory will be freed when the
  1079.                             border is freed.
  1080.  
  1081.                        7).  pointer to menustrip
  1082.                             The gadget will be owned by this menustrip,
  1083.                             the gadget memory will be freed when the
  1084.                             menu is freed.
  1085.  
  1086.  
  1087.           left       - numeric, left edge placement of gadget
  1088.  
  1089.           top        - numeric, top edge placement of gadget
  1090.  
  1091.           width      - numeric, width of gadget in pixels
  1092.  
  1093.           hgt        - numeric, height of gadget in pixels
  1094.  
  1095.           flags      - numeric, gadget flags
  1096.                        GADGHCOMP/GADGIMAGE/GRELRIGHT/GRELWIDTH/SELECTED/etc.
  1097.  
  1098.           activation - numeric, IDCMP flags for the gadget
  1099.                        TOGGLESELECT/GADGIMMEDIATE/RELVERIFY/etc.
  1100.  
  1101.           itext      - pointer to intuitext to be displayed with the gadget.
  1102.                        Note that this can be a linked list of IntuiText.
  1103.                        Keep in mind that the position of the IntuiText is
  1104.                        relative to the gadgets left & top coordinates.
  1105.  
  1106.           bpen       - numeric, border pen color
  1107.                        this function will build a border (only if 'render'
  1108.                        parm is zero) to 'box' the gadget, this is the color 
  1109.                        you want the border lines to be. 
  1110.  
  1111.           render     - pointer to Border/Gadget imagery. 
  1112.                        If this is zero then APIG will build a default 
  1113.                        border structure to 'box' the gadget.
  1114.                        If this is non-zero then APIG assumes this is a
  1115.                        pointer to an appropriate structure for the 
  1116.                        GadgetRender parm and uses it as-is.  You may still
  1117.                        link a Border/Image structure in afterwards.
  1118.                        If this is -1 then APIG will leave the GadgetRender
  1119.                        parm of the Gadget structure NULL, you can then link
  1120.                        a Border/Image structure in afterwards.
  1121.  
  1122.           select     - pointer to Border/Gadget imagery to display when 
  1123.                        selected.  APIG uses what ever you specify so
  1124.                        do not put a -1 here, put a 0 if you want it 
  1125.                        to be NULL.
  1126.  
  1127.           gadid      - numeric, any value you wish to identify this gadget.
  1128.  
  1129.           linkto     - pointer to GADGET to which this gadget should be 
  1130.                        linked this allows you to string several gadgets 
  1131.                        together into a linked list.  The new allocated 
  1132.                        gadget will be placed at the end of the list.
  1133.  
  1134.                        You may also specify a pointer to a WINDOW or a 
  1135.                        pointer to a REQUESTER as the 'linkto'.
  1136.  
  1137.                        If 'linkto' is a window pointer then APIG will
  1138.                        AddGadget() the new gadget to the windows gadget
  1139.                        list. You however must do gadget refreshing.
  1140.  
  1141.                        If 'linkto' is a requester pointer then APIG will
  1142.                        place the new gadget at the end of the requesters
  1143.                        gadget list. Be sure to specify appropriate flags
  1144.                        for requester gadgets.
  1145.  
  1146.      Returns:        - pointer to allocated gadget as an ARexx hex string.
  1147.                      - returns null ('0000 0000'x) if call fails
  1148.  
  1149.                 ARexx Programmers Intuition & Graphics Library
  1150.                           ( version 1.1  09/21/91 )
  1151.  
  1152.  
  1153. ------------------------------------------------ 
  1154.  
  1155. <>  MAKEBORDER( owner,arrayptr,arraycnt,left,top,fp,bp,dm,linkto)
  1156.  
  1157.       Allocates and builds a border structure.
  1158.  
  1159.       Inputs:
  1160.  
  1161.           owner      - pointer to object which will own this border.
  1162.           
  1163.                        if 0 then this will be an independent
  1164.                        border which must be explictly freed.
  1165.  
  1166.                        Owner can also be ANY of the owners described
  1167.                        in the MAKEBOOLGADGET description.
  1168.  
  1169.           arrayptr   - pointer to array of short integers,
  1170.                        taken as XY pairs.
  1171.                        The array can be allocated with ALLOCMEM(), 
  1172.                        and the XY pair values set with SETX() and 
  1173.                        SETY() functions.
  1174.  
  1175.                        If you code a zero here then MAKEBORDER()
  1176.                        will generate a border array for you. 
  1177.                        See parms below.
  1178.  
  1179.           arraycnt   - numeric, number of XY pairs in the array,
  1180.                        must be less than 128.         
  1181.                        
  1182.                        If 'arrayptr' was specified as zero then 
  1183.                        this parm will be the 'thickness' of the
  1184.                        border. If this is the case then 'arraycnt' 
  1185.                        must be <= 25. A value of 0 defaults to 1.
  1186.  
  1187.           left       - numeric, borders left edge
  1188.  
  1189.                        If 'arrayptr' was specified as zero then
  1190.                        this parm will be the width of the border.
  1191.  
  1192.           top        - numeric, borders top edge
  1193.  
  1194.                        If 'arrayptr' was specified as zero then
  1195.                        this parm will be the heigth of the border.
  1196.  
  1197.           fp         - numeric, borders front pen color
  1198.  
  1199.           bp         - numeric, borders back pen color
  1200.  
  1201.           dm         - numeric, drawmode to use
  1202.  
  1203.           linkto     - pointer to a BORDER structure to which the new
  1204.                        border will be linked. Code this as zero if
  1205.                        not linking the border.
  1206.  
  1207.                        You may also specify a pointer to a GADGET or a 
  1208.                        pointer to a REQUESTER as the 'linkto'.
  1209.  
  1210.                        If 'linkto' is a GADGET pointer then APIG will
  1211.                        place the new border at the end of the gadgets 
  1212.                        GadgetRender list.  This implies that gadget has
  1213.                        a GadgetRender list consisting only of borders
  1214.                        or the gadgets GadgetRender pointer is NULL.
  1215.                        Note that the SelectRender pointer is not
  1216.                        modified.
  1217.  
  1218.                        If 'linkto' is a REQUESTER pointer then APIG will
  1219.                        place the new border at the end of the requesters
  1220.                        ReqBorder border list.
  1221.  
  1222.      Returns:        - pointer to allocated Border structure.
  1223.                      - returns null ('0000 0000'x) if call fails
  1224.  
  1225.  
  1226.  
  1227. ------------------------------------------------ 
  1228.  
  1229.  
  1230. <>  MAKEITEM( menustrip,text,menu,left,top,width,height,flags,
  1231.                                ME,COM,fp,bp,dm,itemfill,selectfill )
  1232.  
  1233.  
  1234.       Builds and attaches a menu-item to a menu
  1235.       All arguments are the same as MAKESUBITEM.
  1236.  
  1237.       See MAKESUBITEM below, also see menu hints.
  1238.  
  1239.  
  1240. ------------------------------------------------ 
  1241.  
  1242.                 ARexx Programmers Intuition & Graphics Library
  1243.                           ( version 1.1  09/21/91 )
  1244.  
  1245.  
  1246. <>  MAKEITEXT( owner,text,xpos,ypos,fpen,bpen,dmode,fontattr,linkto )
  1247.  
  1248.       Allocate and build an IntuiText structure.  The memory allocated
  1249.       for the IntuiText will be 'owned' by the task managing the windows
  1250.       IDCMP port.
  1251.  
  1252.       Inputs:
  1253.  
  1254.           owner      - pointer to object which will own this IntuiText.
  1255.           
  1256.                        if 0 then this will be an independent
  1257.                        IntuiText which must be explictly freed.
  1258.  
  1259.                        Owner can also be ANY of the owners described
  1260.                        in the MAKEBOOLGADGET description.
  1261.  
  1262.  
  1263.           text       - string, text you want to build IntuiText for
  1264.  
  1265.           xpos       - numeric, x displacement in pixels
  1266.  
  1267.           ypos       - numeric, y displacement in pixels
  1268.  
  1269.           fpen       - numeric, foreground pen color
  1270.  
  1271.           bpen       - numeric, background pen color
  1272.  
  1273.           dmode      - numeric, draw mode (ie. JAM1,JAM2, etc.)
  1274.  
  1275.           fontattr   - pointer, to text font attributes
  1276.                        (returned by MAKETATTR)
  1277.                        code as zero to get default
  1278.  
  1279.           linkto     - pointer, to IntuiText structure to which this
  1280.                        IntuiText should be linked.
  1281.  
  1282.                        You may also specify a pointer to a GADGET, 
  1283.                        pointer to a REQUESTER, pointer to a MENUITEM, 
  1284.                        or a pointer to a MENUSUBITEM as the 'linkto'.
  1285.  
  1286.                        If 'linkto' is a GADGET pointer then APIG will
  1287.                        place the new IntuiText at the end of the gadgets 
  1288.                        GadgetText list.
  1289.  
  1290.                        If 'linkto' is a REQUESTER pointer then APIG 
  1291.                        will place the new IntuiText at the end of the
  1292.                        requesters ReqText list.
  1293.  
  1294.                        If 'linkto' is a MENUITEM pointer then APIG 
  1295.                        will place the new IntuiText at the end of the
  1296.                        MENUITEMs ItemFill list.  This implies that the
  1297.                        ItemFill of the MENUITEM consist of IntuiText
  1298.                        and is not an IMAGE. MENUSUBITEMS are treated
  1299.                        the same way.  Note the SelectFill is not 
  1300.                        modified.
  1301.  
  1302.  
  1303.      Returns:        - pointer to the allocated IntuiText
  1304.                      - returns null ('0000 0000'x) if call fails
  1305.  
  1306.  
  1307. ------------------------------------------------ 
  1308.  
  1309.       
  1310. <>  MAKEMENU( menuowner,menutext,leftedge,width,flags,menupointer )
  1311.  
  1312.       This function creates/builds a menu header.
  1313.  
  1314.       The parm 'menupointer' determines whether a new menustrip is
  1315.       being constructed or whether a new header is being added to 
  1316.       an existing menustrip.
  1317.  
  1318.       The initial call to MAKEMENU should set the parm 'menupointer'
  1319.       to 0, this indicates the start of a new menustrip.  The initial
  1320.       call builds a MENU structure and returns a pointer to it.  
  1321.  
  1322.       All subsequent calls MUST then use the return value from the 
  1323.       initial call to add new menu headers to the menustrip.  Also 
  1324.       remember that items/subitems will need an owner, it is this
  1325.       initial value that you will use. (if not using a window/screen)
  1326.  
  1327.       eg. /* the last parm is 0, indicating start a new menustrip */
  1328.           /* the first parm is 0, indicating independent menu     */
  1329.           menu0 = MAKEMENU( 0,"Project",left,width,flags,0 )
  1330.           menustrip = menu0
  1331.  
  1332.       eg. /* the last parm is 0, indicating start a new menustrip */
  1333.           /* the first parm is window, indicating menu is owned   */
  1334.           /* by the window, and will be freed when window closes  */
  1335.           menu0 = MAKEMENU( window,"Project",left,width,flags,0 )
  1336.           menustrip = menu0
  1337.  
  1338.           to add additional menu headers to the menustrip the
  1339.           return value menu0 must now must be used as the 
  1340.           'menupointer' parm.
  1341.  
  1342.       eg. /* the last parm is non-null, indicating link the */
  1343.           /* new menu to it, owner simply says who owns the */
  1344.           /* new allocated menu structure memory            */
  1345.           menu1 = MAKEMENU( menu0,"This",left,width,flags,menu0 )
  1346.           menu2 = MAKEMENU( menu0,"That",left,width,flags,menu0 )
  1347.           or
  1348.           menu3 = MAKEMENU( menustrip,"Whatever",left,width,flags,menu0 )
  1349.            (since menustrip was assigned the value of menu0)
  1350.  
  1351.           menu headers which are not owners returned from the initial
  1352.           call cannot be used to build the menustrip.
  1353.  
  1354.       eg. menu4 = MAKEMENU( menu1,"Lastone",left,width,flags,menu0 )
  1355.  
  1356.           the above will NOT work, menu1, was not returned from the initial
  1357.           call, result is a null pointer for the value of menu4.  
  1358.  
  1359.  
  1360.       This differs from APIG version 0.5, and allows you to re-use
  1361.       menu strips after the window has been closed.
  1362.  
  1363.       You must now explicitly release memory that has been allocated
  1364.       to independent menustrips, using the FREEMENU() function.
  1365.       
  1366.  
  1367.       Inputs:
  1368.       
  1369.           menuowner     - pointer to object which will own the MENU.
  1370.  
  1371.                         For menus valid owners can only be:
  1372.  
  1373.                         0).  0 - code as zero when creating new independent
  1374.                              menustrip.  You will need to free it with
  1375.                              FREEMENU.
  1376.  
  1377.                         1). pointer to window
  1378.  
  1379.                         2). pointer to screen
  1380.  
  1381.                         3). pointer to independent MENU
  1382.  
  1383.                         Menus cannot be owned by any other structure.
  1384.                         ie.  gadgets, intuitext, etc. cannot be owners
  1385.                         of a menu.
  1386.  
  1387.           
  1388.           menutext    - string, text to be displayed in menu header
  1389.           
  1390.           leftedge    - numeric, location of menu select box.
  1391.                         (measured in pixels)
  1392.           
  1393.                         If leftedge >= 0 then the left edge is
  1394.                         measured from the right edge of the 
  1395.                         MENU which PRECEDES it.
  1396.                         
  1397.                         If leftedge < 0 then the left edge is
  1398.                         measured from the leftedge of the screen.
  1399.                         
  1400.                         +--------+ +--------+     +----------+
  1401.                         | MENU 1 | | MENU 2 | ... | MENU N-1 | 
  1402.                         +--------+ +--------+     +----------+   
  1403.                         |                                    |
  1404.                         |                                    |
  1405.                         |                                    |<--- meas.
  1406.              left       |                                    |from here if
  1407.              edge       |<--- meas.                          |'leftedge' >= 0
  1408.              screen --> |from here                           |for MENU N
  1409.                         | if 'leftedge' < 0                  |
  1410.                         | for MENU N                         |
  1411.                         |                                    |
  1412.               
  1413.               
  1414.  
  1415.           width       - numeric specifies width of MENU select box.
  1416.                         (measured in pixels)
  1417.                         If zero, then the IntuiTextLength of the
  1418.                         'menutext' is used.
  1419.                         If 'menutext' is a NULL string then the 
  1420.                         IntuiTextLength of 1 character is used.
  1421.  
  1422.  
  1423.           flags       - numeric, this is the Flags variable of the
  1424.                         Menu structure, only meaningful values are
  1425.                         MENUENABLED or 0 (menu will be disabled).
  1426.  
  1427.  
  1428.           menupointer - pointer to a menustrip in which this menu
  1429.                         should be linked.  If this is zero then
  1430.                         it indicates you are building a new menu
  1431.                         strip.
  1432.           
  1433.           Returns:    - pointer to menu.
  1434.                       - null ('0000 0000'x) if call fails
  1435.                       
  1436.                       
  1437.       Note that the menu strip is not attached to the window, the menu
  1438.       is simply constructed.  You will need to call SetMenuStrip to
  1439.       actually attach the menu strip to the window.
  1440.  
  1441.                 ARexx Programmers Intuition & Graphics Library
  1442.                           ( version 1.1  09/21/91 )
  1443.  
  1444. ------------------------------------------------ 
  1445.  
  1446.  
  1447. <>  MAKEPROPGADGET( owner,left,top,width,hgt,flags,activation,itext,
  1448.                           ,piflags,hbody,vbody,gadid,linkto,knobimage)
  1449.       
  1450.       Allocate and build a proportional gadget structure.
  1451.       (Note parms are different than version 0.5, hbody/vbody/knobimage)
  1452.  
  1453.       Inputs:
  1454.       
  1455.           owner      - pointer to object which will own this Gadget.
  1456.                        See description of MAKEBOOLGAGET.
  1457.           
  1458.           left       - numeric, left edge placement of gadget
  1459.           
  1460.           top        - numeric, top edge placement of gadget
  1461.           
  1462.           width      - numeric, width of gadget in pixels
  1463.           
  1464.           hgt        - numeric, height of gadget in pixels
  1465.           
  1466.           flags      - numeric, gadget flags
  1467.  
  1468.           activation - numeric, IDCMP flags for the gadget
  1469.           
  1470.           itext      - pointer to intuitext to be displayed with the gadget
  1471.           
  1472.           piflags    - numeric, specifies the prop gadgets characteristics
  1473.                        AUTOKNOB/FREEHORIZ/FREEVERT/KNOBHIT/PROPBORDERLESS
  1474.           
  1475.           hbody      - numeric, specifies the horizontal step (percentage)
  1476.                        amount
  1477.           
  1478.           vbody      - numeric, specifies the vertical step (percentage)
  1479.                        amount
  1480.  
  1481.           gadid      - numeric, any value you wish to identify this gadget
  1482.           
  1483.           linkto     - pointer, gadget to which this gadget should be
  1484.                        linked.
  1485.                        See description of MAKEBOOLGADGET all the same
  1486.                        applies.
  1487.  
  1488.           knobimage  - pointer, this points to an image. This image will be
  1489.                        used as the prop gadgets knob.  This allows you to
  1490.                        use custom slider knobs in your proportional gadgets
  1491.                        instead of just a rectangluar knob.
  1492.           
  1493.      Returns:        - pointer to allocated gadget as a rexx hex string.
  1494.                      - returns null ('0000 0000'x) if call fails
  1495.  
  1496.  
  1497.           Note: HORIZPOT & VERTPOT will be initialized to zero.
  1498.  
  1499.                 ARexx Programmers Intuition & Graphics Library
  1500.                           ( version 1.1  09/21/91 )
  1501.  
  1502. ------------------------------------------------ 
  1503.  
  1504.  
  1505. <>  MAKERASTPORT(width,height,depth,owner)
  1506.  
  1507.       This function allocates and builds a rastport structure and returns
  1508.       a pointer to it.  The purpose for this is to allow you to build 
  1509.       off-screen rastports then blit them on screen when ready.
  1510.       
  1511.       Inputs:
  1512.       
  1513.           width      - numeric, width of the rastports bitmap
  1514.           
  1515.           height     - numeric, height of the rastports bitmap
  1516.           
  1517.           depth      - numeric, number of bit planes in rastports bitmap
  1518.           
  1519.           owner      - pointer to object which will own this rastport.
  1520.                        code as zero if independent rastport, in which
  1521.                        case it must be explicitly freed, with FREERASTPORT
  1522.                        or FREEBIRASIM.
  1523.  
  1524.                      - pointer  Any other independent owner see 
  1525.                        description of owners under MAKEBOOLGAGET.
  1526.                        Their are no restrictions on who/what can 
  1527.                        own a rastport.
  1528.  
  1529.       Returns:       - pointer to rastport structure
  1530.                      - returns null ('0000 0000'x) if call fails
  1531.  
  1532.                 ARexx Programmers Intuition & Graphics Library
  1533.                           ( version 1.1  09/21/91 )
  1534.                      
  1535. ------------------------------------------------ 
  1536.  
  1537.                      
  1538. <>  MAKEREQUESTER(window,left,top,width,height,gadget,text,border,
  1539.                                    backfill,flags,relleft,reltop,bm)
  1540.  
  1541.       This function builds an instance of a requester structure to be
  1542.       used with the REQUEST() function.
  1543.       
  1544.       Inputs:
  1545.       
  1546.           owner      - pointer to object which will own this Gadget.
  1547.                        See description of MAKEBOOLGAGET.
  1548.           
  1549.           left       - numeric, left edge offset of the requester
  1550.           
  1551.           top        - numeric, top edge offset of the requester
  1552.           
  1553.           width      - numeric, width of the requester
  1554.           
  1555.           height     - numeric, height of the requester
  1556.           
  1557.           gadget     - pointer to first gadget of list of gadgets within
  1558.                        the requester.  YOU should also make sure that
  1559.                        at least one of the gadgets in the list has its
  1560.                        ENDGADGET flag set.
  1561.                        APIG will set the gadgettype flag of all gadgets in 
  1562.                        this list to REQGADGET.
  1563.  
  1564.           text       - pointer to intuitext for the requester
  1565.           
  1566.           border     - pointer to a border structure
  1567.           
  1568.           backfill   - numeric, pen color to fill requester, before graphics
  1569.                        are rendered
  1570.  
  1571.           flags      - numeric, requester flags specify POINTREL,PREDRAWN
  1572.                        otherwise code as zero
  1573.  
  1574.           relleft    - numeric, left offset for requesters displayed 
  1575.                        relative to the mouse pointer (ie. POINTREL set)
  1576.  
  1577.           reltop     - numeric, top offset for requesters displayed 
  1578.                        relative to the mouse pointer (ie. POINTREL set)
  1579.  
  1580.           bm         - pointer to a bitmap containing imagery for the 
  1581.                        requester, the PREDRAWN flag must be set. 
  1582.                        Code as zero if not using your own imagery.
  1583.  
  1584.       Returns:       - pointer to a requester structure
  1585.                      - null ('0000 0000'x) if call fails
  1586.  
  1587.                 ARexx Programmers Intuition & Graphics Library
  1588.                           ( version 1.1  09/21/91 )
  1589.  
  1590. ------------------------------------------------ 
  1591.  
  1592.  
  1593. <>  MAKESTRGADGET( window,left,top,width,hgt,flags,activation,
  1594.                           itext,bpen,render,select,gadid,linkto,strlen)
  1595.       
  1596.       Allocate and build a string gadget structure.
  1597.  
  1598.       Inputs:
  1599.       
  1600.           owner      - pointer to object which will own this Gadget.
  1601.                        See description of MAKEBOOLGAGET.
  1602.           
  1603.           
  1604.           left       - numeric, left edge placement of gadget
  1605.           
  1606.           top        - numeric, top edge placement of gadget
  1607.           
  1608.           width      - numeric, width of gadget in pixels
  1609.           
  1610.           hgt        - numeric, height of gadget in pixels
  1611.           
  1612.           flags      - numeric, gadget flags
  1613.           
  1614.           activation - numeric, IDCMP flags for the gadget
  1615.           
  1616.           itext      - pointer to intuitext to be displayed with the gadget
  1617.           
  1618.           bpen       - border pen color
  1619.                        this function will build a border structure
  1620.                        (only if 'render' parm is NULL/ZERO) to 'box'
  1621.                        the gadget, this is the color you want the border 
  1622.                        lines to be. 
  1623.           
  1624.           render     - pointer to Border/Gadget imagery. 
  1625.                        If this is zero then APIG will build a default 
  1626.                        border structure to 'box' the gadget.
  1627.                        If this is -1 then APIG will leave the GadgetRender
  1628.                        parm of the Gadget structure NULL, you can then link
  1629.                        a Border/Image structure in afterwards.
  1630.  
  1631.           select     - pointer to Border/Gadget imagery to display when 
  1632.                        selected.  APIG uses whatever you specify so
  1633.                        do not put a -1 here, code a 0 if you want it 
  1634.                        to be NULL.
  1635.  
  1636.           gadid      - numeric, any value you wish to identify this gadget
  1637.           
  1638.           linkto     - pointer, gadget to which this gadget should be
  1639.                        linked.
  1640.                        See description of MAKEBOOLGADGET all the same
  1641.                        applies.
  1642.           
  1643.           
  1644.           strlen     - numeric, max number of characters allowed in gadget
  1645.  
  1646.  
  1647.      Returns:        - pointer to allocated gadget as a rexx hex string.
  1648.                      - returns null ('0000 0000'x) if call fails
  1649.  
  1650. ------------------------------------------------ 
  1651.  
  1652.                 ARexx Programmers Intuition & Graphics Library
  1653.                           ( version 1.1  09/21/91 )
  1654.  
  1655.       
  1656. <>  MAKESUBITEM( menustrip,text,item,left,top,width,height,flags,
  1657.                                ME,COM,fp,bp,dm,itemfill,selectfill )
  1658.  
  1659.       This function builds and attaches a sub-item to a menu-item. 
  1660.       This description also applies to MAKEITEM().
  1661.  
  1662.  
  1663.       Inputs:
  1664.       
  1665.           menustrip  - pointer to a menustrip, returned from initial call
  1666.                        of MAKEMENU().
  1667.           
  1668.           
  1669.           text       - text string, item text to be used
  1670.                        this parm along with fp,bp, and dm parameters will
  1671.                        be used to build an IntuiText structure.  
  1672.                        The 'itemfill' variable of the MenuItem structure 
  1673.                        will be initialized to point to the IntuiText
  1674.                        constructed.
  1675.                        
  1676.                        
  1677.           item       - pointer to a menu-item, as returned by MAKEITEM()
  1678.                        function. This is the menu-item you want to attach 
  1679.                        the sub-item to
  1680.                        
  1681.                        For MAKEITEM() this is menu pointer returned by
  1682.                        MAKEMENU()
  1683.                        
  1684.                        
  1685.           left       - numeric, left offset relative to menu select box
  1686.           
  1687.                        The value you specify here is critical to the 
  1688.                        placement of the item select box, this value 
  1689.                        determines where the LEFTEDGE of the select box
  1690.                        will be placed.
  1691.                        
  1692.                        eg. 
  1693.                            +-------------------+
  1694.                            |      MENU         |
  1695.                            |     HEADER        |
  1696.                            |       BOX         |
  1697.                            +-------------------+
  1698.                            |                   |
  1699.                            |                   |
  1700.                            |                   |
  1701.                            |from               |
  1702.                            |this               |
  1703.                            |edge               |
  1704.                            |                   |
  1705.                       -x   |   +x              |
  1706.                      <--- out --->             |
  1707.                            |                   |
  1708.                            |                   |
  1709.                            +----------+
  1710.                            | MENUITEM | menuitem will be positioned
  1711.                            +----------+ relative menu box.
  1712.                        
  1713.                            +----------+
  1714.                            | SUB ITEM | subitem will be positioned
  1715.                            +----------+ relative menu box.
  1716.                               
  1717.                        
  1718.  
  1719.           top        - numeric, top offset relative to menu select box
  1720.                        the value you specify here is critical to the 
  1721.                        placement of the item select box.
  1722.                        
  1723.                        if 'top' < 65535 then the select box is measured 
  1724.                        from the bottom of the previous menu.
  1725.                        
  1726.                        eg.  top = 0, places top edge of select box
  1727.                             immediately below the item/subitem that
  1728.                             precedes it.
  1729.  
  1730.                             top = 20, places top edge of select box
  1731.                             20 pixels below the item/subitem that 
  1732.                             precedes it.
  1733.                        
  1734.  
  1735.                        if 'top' < 0 then the select box is measured from
  1736.                        the top edge of the previous menu item.
  1737.                        (the height of the previous item is NOT included)
  1738.  
  1739.  
  1740.                        if 'top' > 65535 then the select box is measured
  1741.                        from the top edge of the menu (modulo 65536).
  1742.                        
  1743.                        
  1744.                          +----------------+ top > 65535 measure
  1745.                          |    MENU BAR    | from here down
  1746.                          +----------------+
  1747.                                  .
  1748.                                  .
  1749.                                  
  1750.                              MENU ITEMS
  1751.                                  .
  1752.                                  .
  1753.                                  
  1754.                          +----------------+ top <= -1 measusre
  1755.             previous     | ^  MENU/ITEM   | from here down
  1756.             menu item    | |              | 
  1757.                          | |              | 
  1758.                          | height         | 
  1759.                          | |              | 
  1760.                          | |              | 
  1761.                          | v              | 
  1762.                          +----------------+ 0 <= top < 65535 measure
  1763.                                             from here down
  1764.  
  1765.  
  1766.                                 +-----------+ <--- this edge will be
  1767.                                 |  SUB ITEM |      relative to one of
  1768.                                 +-----------+      the edges above, 
  1769.                                                    depending on value
  1770.                                                    of 'top'
  1771.  
  1772.  
  1773.           width      - numeric, width of the item select box
  1774.                        code as zero to get default, the default width is
  1775.                        the IntuiTextLength of the 'text' string parameter.
  1776.                        Do Not use negative values here.
  1777.                        
  1778.           height     - numeric, height of the item select box
  1779.                        code as zero to get default, the default height
  1780.                        is the text height of the font for the rastport.
  1781.                        Do Not use negative values here.
  1782.           
  1783.           flags      - numeric, flags for the item
  1784.                        Code as zero to get default, the default value
  1785.                        for menu-items and sub-items is
  1786.                        ITEMTEXT+HIGHCOMP+ITEMENABLED
  1787.                        
  1788.                        If you specify a non-zero value here then you 
  1789.                        must COMPLETELY specify the flag value.
  1790.                        
  1791.                        eg. If you use COMMSEQ to specify that command
  1792.                        sequence character be displayed, then the flag
  1793.                        value is simply set to COMMSEQ. 
  1794.                        
  1795.                        the complete flag value should be specified as
  1796.                        ITEMTEXT+HIGHCOMP+ITEMENABLED+COMMSEQ
  1797.                        (or whatever you want)
  1798.           
  1799.           ME         - numeric, mutual exclude mask
  1800.           
  1801.           COM        - text string, command sequence character
  1802.                        the first character of the string is used
  1803.                        
  1804.           fp         - numeric, front pen color for the item text
  1805.                        
  1806.           bp         - numeric, back pen color for the item text
  1807.           
  1808.           dm         - numeric, draw mode to use for the item text
  1809.           
  1810.           itemfill   - pointer to an IntuiText, or Image structure 
  1811.                        If this parameter is non-zero, then it will be
  1812.                        used, the IntuiText structure will NOT be built
  1813.                        from the text, fp, bp, and dm parameters.
  1814.                        If this parameter is -1 then APIG will leave the
  1815.                        menuitem's ItemFill parameter NULL.
  1816.                        Yes you can specify a pointer to an Image structure
  1817.                        here.
  1818.  
  1819.           selectfill - pointer to an Image structure 
  1820.                        this Image will be displayed when the mouse pointer
  1821.                        is pointing to this sub-item. To use this the
  1822.                        HIGHIMAGE flag must be set.  If no image to display
  1823.                        then code this as a zero.  APIG uses whatever you
  1824.                        put here, do not use -1.
  1825.           
  1826.           Returns:   - pointer to sub-item
  1827.           
  1828.           Note that the menu is not attached to the window, the item
  1829.           is simply constructed.  You will need to call SetMenuStrip to
  1830.           actually attach the menu strip to the window.
  1831.           
  1832.           Also see menu hints.
  1833.  
  1834.                 ARexx Programmers Intuition & Graphics Library
  1835.                           ( version 1.1  09/21/91 )
  1836.  
  1837.           
  1838. ------------------------------------------------ 
  1839.  
  1840. <>  MAKESTRUCT(owner,type,size,mem_type)
  1841.     MAKEPOINTER is synonymous with MAKESTRUCT
  1842.  
  1843.     This function allocates an Intuition structure pointer.
  1844.  
  1845.     All pointers made by APIG have specific information about the 
  1846.     pointer at negative offsets.  APIG uses this information to 
  1847.     validate the pointer.  See the section below describing APIG
  1848.     pointers.
  1849.  
  1850.  
  1851. ------------------------------------------------ 
  1852.  
  1853.  
  1854. <>  MAKETATTR(window,fontname,fontsize )
  1855.       
  1856.       Allocate and build an Text Font Attribute structure.
  1857.       The value returned by this function is used with OPENFONT() to load
  1858.       a text font from disk, and to specify fonts for intuitext.
  1859.       
  1860.       Note OPENFONT() returns a pointer to a TextFont structure, which 
  1861.       is NOT used in MAKEITEXT(). 
  1862.       
  1863.       
  1864.       Inputs:
  1865.       
  1866.           window     - pointer to a window opened with OPENWINDOW().
  1867.                        This must be a pointer to a window.
  1868.           
  1869.           fontname   - string, name of the font to use
  1870.           
  1871.           fontsize   - numeric, size of the specified font to use
  1872.       
  1873.  
  1874.      Returns:        - pointer (rexx hex string) to the allocated TextAttr
  1875.                      - returns null ('0000 0000'x) if call fails
  1876.  
  1877.                      
  1878. ------------------------------------------------ 
  1879.  
  1880.  
  1881. <>  MENUNUMBER(menustrip,menu,item,subitem)
  1882.  
  1883.       This function generates a 'MENUNUMBER'.
  1884.       
  1885.       Inputs:
  1886.       
  1887.           menustrip  - pointer to first menu in a menustrip
  1888.           
  1889.           menu       - pointer to a menu within the menustrip
  1890.           
  1891.           item       - pointer to a menu-item within the specified menu
  1892.           
  1893.           subitem    - pointer to a sub-item within the specified item
  1894.                        (code as zero if no sub-item)
  1895.           
  1896.       Returns:       - numeric, 'MENUNUMBER'.
  1897.  
  1898.  
  1899. ------------------------------------------------ 
  1900.  
  1901.                 ARexx Programmers Intuition & Graphics Library
  1902.                           ( version 1.1  09/21/91 )
  1903.  
  1904.  
  1905.  
  1906. <>  MOUSEFREQUENCY(window,N) 
  1907.  
  1908.       This function allows you to specify how often you want to receive
  1909.       MOUSEMOVE messages from INTUITION.  The task managing the windows IDCMP
  1910.       builds an ARexx message for the MOUSEMOVE event it receives, and 
  1911.       immediately replies to INTUITION, afterwhich it then sends the ARexx
  1912.       message packet to you.  The rate at which INTUITION sends MOUSEMOVEs
  1913.       might be faster than your ARexx macro can keep up with.  This function 
  1914.       will cause the task to 'swallow' every 'Nth' MOUSEMOVE message.
  1915.       
  1916.       Inputs:
  1917.       
  1918.           window    - pointer to window opened with OPENWINDOW().
  1919.           
  1920.           N         - numeric, frequency at which MOUSEMOVES should be 
  1921.                       sent to you
  1922.           
  1923.       eg.  x = mousefrequency(window,50)
  1924.            will cause you to receive every 50th MOUSEMOVE message.
  1925.            
  1926.       eg.  x = mousefrequency(window,1)
  1927.            will get you all MOUSEMOVE messages.
  1928.            
  1929.            specifing a value of zero will default to 1.
  1930.            
  1931.            When a window is initially opened its mousefrequency is 1.
  1932.            
  1933.       Returns:      - returns N, the value you specified.
  1934.       
  1935.       Note that you must specify MOUSEMOVES in the idcmp parameter in 
  1936.       order to get MOUSEMOVE event messages.
  1937.  
  1938.  
  1939. ------------------------------------------------ 
  1940.  
  1941.                 ARexx Programmers Intuition & Graphics Library
  1942.                           ( version 1.1 09/21/91 )
  1943.  
  1944.  
  1945.       
  1946. <>  OPENWINDOW( portname,left,top,wid,hgt,dpen,bpen,IDCMP,flags,
  1947.                               title,scr,console,bitmap,chkmark )
  1948.  
  1949.       
  1950.       Opens a window for use with the graphics/intuition library functions.  
  1951.       Each call to this function creates a separate task to manage the IDCMP 
  1952.       port for the window.
  1953.       
  1954.       Inputs:
  1955.       
  1956.           portname   - name of the public message port where IDCMP 
  1957.                        messages should be sent. The public port
  1958.                        should be allocated prior to making the call
  1959.                        to 'OPENWINDOW'.
  1960.  
  1961.                        The parameter 'portname' is a string which is
  1962.                        the name of a public message port opened with 
  1963.                        the ARexx OPENPORT function.
  1964.       
  1965.                        eg. portname = 'myport'  
  1966.                            msgport  = openport(portname)
  1967.       
  1968.           left       - numeric, position of the left edge of the window
  1969.           
  1970.           top        - numeric, position of the top edge of the window 
  1971.           
  1972.           wid        - numeric, width of the window
  1973.           
  1974.           hgt        - numeric, height of the window
  1975.           
  1976.           dpen       - numeric, detail pen to use
  1977.           
  1978.           bpen       - numeric, block pen to use 
  1979.           
  1980.           IDCMP      - numeric, IDCMP flags - the set of messages that will 
  1981.                        be reported.
  1982.                        The value you specify here determines what types of
  1983.                        messages you will receive from INTUITION.  Be careful
  1984.                        about the value you put here, since this value gets
  1985.                        passed to Intuition's OpenWindow() function. 
  1986.                        eg. If you code a zero then Intuition doesnt even
  1987.                        bother opening up an IDCMP, and the window task will
  1988.                        never send you a message packet. 
  1989.                        (youll then find yourself waiting forever for a
  1990.                         message to arrive at your Rexx message port)
  1991.  
  1992.           flags      - numeric, window flags 
  1993.           
  1994.           title      - string, window title string
  1995.           
  1996.           scr        - screen in which window should appear, this should
  1997.                        be a  pointer returned by the 'OPENSCREEN' function. 
  1998.                        If the window is to appear in the workbench screen 
  1999.                        code this as a zero
  2000.  
  2001.           console    - numeric, this parameter determines whether a
  2002.                        'console' will be attached to the window.
  2003.                        Specifying any non-zero value here will cause a
  2004.                        'console' to be attached.  You will then be able
  2005.                        to write to the window using WRITECONSOLE().
  2006.  
  2007.                        Note: Their is no function to read from the console
  2008.                              use the IDCMP RAWKEY or VANILLAKEYS flag.
  2009.                        
  2010.           bitmap     - pointer to bitmap, if non-zero this implies that
  2011.                        the window is a superbitmap window. 
  2012.                        'bitmap' should then point to a valid bitmap
  2013.                        obtained from MAKEBITMAP() function.  You must
  2014.                        also set the appropriate window/screen flag values.
  2015.                        
  2016.           chkmark    - pointer to an image, if non-zero this should point 
  2017.                        to an image obtained with the function LOADIMAGE().  
  2018.                        This imagery will be used as the check mark for
  2019.                        menu items.
  2020.  
  2021.      Only a few of the inputs are checked for validity, I can only assume 
  2022.      you know what you want to do. So be careful when specifing the inputs.
  2023.      
  2024.      Returns:        - returns pointer to a window as a Rexx hex string.
  2025.                        returns null hex string (ie. '0000 0000'x) if open 
  2026.                        fails.
  2027.                        
  2028.  
  2029.       Intuition events received at the windows IDCMP port will be sent to
  2030.       the public port specified by portname.  If the public port cannot
  2031.       be found  the OPENWINDOW call will fail. 
  2032.  
  2033.       Intuition events are sent to the public port as RexxMsg packets.  
  2034.       Depending on the type of intuition event received, the argument
  2035.       slots of the packet will contain specific information about the
  2036.       event.
  2037.       
  2038.       The intui-event information is returned in separate slots of the 
  2039.       ARexx message packet as follows:
  2040.  
  2041.            arg0 - CLASS 
  2042.                   numeric string, class of the intui-event
  2043.                   
  2044.            arg1 - CODE 
  2045.                   numeric string, code of the intui-event
  2046.                   
  2047.            arg2 - QUALIFIER 
  2048.                   numeric string, qualifier of the intui-event
  2049.                   
  2050.            arg3 - MOUSEX 
  2051.                   numeric string, mouse position x coord.
  2052.  
  2053.            arg4 - MOUSEY 
  2054.                   numeric string, mouse position y coord.
  2055.  
  2056.            arg5 - SECONDS 
  2057.                   numeric string, event time stamp
  2058.  
  2059.            arg6 - MICROS 
  2060.                   numeric string, event time stamp
  2061.                   
  2062.            arg7 - WINDOW
  2063.                   a Rexx hex string, which is the address of the window
  2064.                   in which the event occured.
  2065.                   
  2066.            arg8 - IADDRESS
  2067.                   a Rexx hex string, IAddress of the intui-event
  2068.                   this typically will be the address of a gadget causing
  2069.                   the event
  2070.                   
  2071.            arg9 - GADGETID
  2072.                   numeric string, if the event is a gadget related event
  2073.                   this will be the GadgetID of the gadget
  2074.      
  2075.            The remaining slots are not used
  2076.  
  2077.  
  2078.       Upon receiving a message you should then use the ARexx functions
  2079.       GETPKT(), and GETARG() to examine the values of the intuition
  2080.       message. After you are done using the message you should then
  2081.       'reply' back to the window task using the ARexx function REPLY().
  2082.  
  2083.       eg.  After allocating a port and opening a window;
  2084.       
  2085.           exitme = 0
  2086.           do forever  /* loop forever */
  2087.  
  2088.              x = waitpkt(portname)  /* wait for next message(s) to arrive */
  2089.   
  2090.              do forever    /* loop thru all received messages */
  2091.   
  2092.                 msg = GETPKT(portname)
  2093.                 if msg = '0000 0000'x then leave
  2094.                 class     = GETARG(msg,0)
  2095.                 code      = GETARG(msg,1)
  2096.                 qualifier = GETARG(msg,2)
  2097.                 mousex    = GETARG(msg,3)
  2098.                 mousey    = GETARG(msg,4)
  2099.                 seconds   = GETARG(msg,5)
  2100.                 micros    = GETARG(msg,6)
  2101.                 window    = GETARG(msg,7)
  2102.                 iaddress  = GETARG(msg,8)
  2103.                 gadgetid  = GETARG(msg,9)  /* zero if not gadget related */
  2104.                 
  2105.                 if class = 512 then exitme = 1   /* class 512 = CLOSEWINDOW */
  2106.                 
  2107.                 x = REPLY(msg,0)    /* you MUST reply to all messages */
  2108.              end  
  2109.              
  2110.              if exitme = 1 then leave
  2111.    
  2112.           end
  2113.  
  2114.                 ARexx Programmers Intuition & Graphics Library
  2115.                           ( version 1.1 09/21/91 )
  2116.  
  2117.  
  2118.       The window task created will have the name 'apig.task.N', where N
  2119.       is a sequential number used to uniquely identify the task managing
  2120.       the windows IDCMP port.  This tasks creates several private msgports
  2121.       for communicating with the library functions, however one public
  2122.       message port is created for sending commands directly to the task.
  2123.       The name of this public message port will be the same as the task
  2124.       name (ie.  'apig.task.N').  Commands are sent to the public message
  2125.       port via the Rexx 'address' command.
  2126.  
  2127.       The only commands recognized at the task public message port are
  2128.       
  2129.       "DIE"  -  this command tells the task to kill itself and return all
  2130.                 allocated resources it owns back to the system.  
  2131.                 Note the task knows nothing about independent structures
  2132.                 that have been allocated and will NOT free them.
  2133.                 It does know about all other memory that has been 
  2134.                 allocated to (owned by) its window and thus WILL free it.
  2135.                 
  2136.                 The primary use for this command will arise when the window 
  2137.                 is left hanging open due to termination of your ARexx macro
  2138.                 because of an error.
  2139.  
  2140.                 eg.  from CLI prompt you could enter 
  2141.                      (assuming you are running WSHELL)
  2142.                 
  2143.                 >    "address 'apig.task.1' DIE"
  2144.                     
  2145.                      This will (hopefully) tell the apig.task.1 to
  2146.                      close the window and kill itself. If the window is
  2147.                      opened on a custom screen the screen will be closed
  2148.                      as well.
  2149.                      
  2150.                      If multiple windows are opened on a custom screen
  2151.                      then each window must be told to die. When the last
  2152.                      window is closed the custom screen will be closed.
  2153.                 
  2154.                      
  2155.        Note:  If you know the address of the window you can also close it
  2156.               from the command line with:
  2157.               
  2158.               > "say closewindow('wwww wwww'x)"
  2159.                 where 'wwww wwww'x is the hex address of the window.
  2160.                 if the window is on a screen, the screen will NOT be closed,
  2161.                 even if the window is the last/only window in the screen.
  2162.                 Memory (gadgets, intuitexts, menus, etc.) allocated to the 
  2163.                 window will be freed.
  2164.                 
  2165.               > "say closescreen('ssss ssss'x)"
  2166.                  will close a screen from the command line
  2167.                  
  2168.               APIG will only close windows/screens which it has opened.
  2169.  
  2170.  
  2171. ------------------------------------------------ 
  2172.  
  2173.                 ARexx Programmers Intuition & Graphics Library
  2174.                           ( version 1.1 09/21/91 )
  2175.  
  2176.  
  2177. <>  OPENSCREEN( left,top,width,height,depth,dpen,bpen,vmodes,
  2178.                               type,title )
  2179.  
  2180.       Opens a custom screen for your use.
  2181.       
  2182.       Inputs:
  2183.       
  2184.           left       - numeric, screens left edge
  2185.           
  2186.           top        - numeric, screens top edge
  2187.           
  2188.           width      - numeric, screens width
  2189.           
  2190.           height     - numeric, screens height
  2191.           
  2192.           depth      - numeric, screen depth, number of bit planes
  2193.           
  2194.           dpen       - numeric, detail pen to use
  2195.           
  2196.           bpen       - numeric, block pen to use
  2197.           
  2198.           vmodes     - numeric, view modes flag
  2199.           
  2200.           type       - numeric, type of screen
  2201.                        CUSTOMSCREEN, WBENCHSCREEN, SCREENBEHIND, etc.
  2202.           
  2203.           title      - string, screen title
  2204.           
  2205.  
  2206.      Returns:        - returns pointer to screen as a Rexx hex string
  2207.                        returns null hex string (ie. '0000 0000'x) if
  2208.                        open fails.
  2209.  
  2210.  
  2211. ------------------------------------------------ 
  2212.  
  2213.  
  2214. <>  PITEXT(rp,left,top,text,fp,bp,dm,font)
  2215.  
  2216.       This function builds an IntuiText structure using the values
  2217.       you specify and then calls PrintIText to display the text in
  2218.       the RastPort.  The IntuiText structure created is immediately
  2219.       discarded.  The purpose is to allow you to render text in the
  2220.       rastport, without having to make SetAPen,SetBPen etc. calls
  2221.       between Text() calls.
  2222.       
  2223.       Inputs:
  2224.       
  2225.           rp         - pointer to rastport in which to display text
  2226.           
  2227.           left       - numeric, left edge offset relative to rastport
  2228.           
  2229.           top        - numeric, top edge offset relative to rastport
  2230.           
  2231.           text       - text string to be displayed
  2232.           
  2233.           fp         - numeric, front pen color
  2234.           
  2235.           bp         - numeric, back pen color
  2236.           
  2237.           dm         - numeric, draw mode (JAM1,JAM2,etc)
  2238.           
  2239.           font       - font to use, ( from MAKETATTR() )
  2240.           
  2241.           
  2242.       Returns:       - always returns 1    
  2243.  
  2244.  
  2245. ------------------------------------------------ 
  2246.  
  2247.                 ARexx Programmers Intuition & Graphics Library
  2248.                           ( version 1.1 09/21/91 )
  2249.  
  2250.  
  2251. <>  SAVEIFF(bitmap,filename,colortab,HAM,compress)
  2252.  
  2253.       This function uses Christian Weber's iff.library to save an IFF file.
  2254.       
  2255.       Inputs:
  2256.       
  2257.           bitmap     - pointer to bitmap containing IFF imagery.
  2258.  
  2259.           filename   - the name of the file to save IFF.
  2260.           
  2261.                        
  2262.           colortab   - pointer to a color table, ie. array of 16bit values.
  2263.           
  2264.           HAM        - numeric, if non-zero specifies to save as HAM image.
  2265.           
  2266.           compress   - numeric, if non-zero specifies to save UN-COMPRESSED
  2267.                        default is to save COMPRESSED
  2268.           
  2269.       Returns:       - returns 1 if sucessful, otherwise zero.
  2270.       
  2271.  
  2272. ------------------------------------------------ 
  2273.  
  2274.  
  2275. <>  SAVEIFFCLIP(bitmap,filename,x,y,w,h,colortab,HAM,compress)
  2276.  
  2277.       This function uses Christian Weber's iff.library to save a
  2278.       rectangular region of a bitmap as an IFF file.
  2279.       
  2280.       Inputs:
  2281.       
  2282.           bitmap     - pointer to bitmap containing IFF imagery.
  2283.  
  2284.           filename   - the name of the file to save IFF.
  2285.           
  2286.           x          - numeric, horizontal offset into bitmap
  2287.           
  2288.           y          - numeric, vertical offset into bitmap
  2289.           
  2290.           w          - numeric, width of rectangle, expressed in bytes.
  2291.                        (ie. number of pixels divided by 8)
  2292.           
  2293.           h          - numeric, height of rectangle, expressed in lines.
  2294.                        (ie. number of raster lines)
  2295.                        
  2296.           colortab   - pointer to a color table, ie. array of 16bit values.
  2297.           
  2298.           HAM        - numeric, only meaningful value here is a viewmode
  2299.                        of HAM (2048).
  2300.                        ie. a value of 2048  specifies to save as HAM image.
  2301.                        code as 2048 (0x0800) or zero
  2302.           
  2303.           compress   - numeric, if non-zero specifies to save UN-COMPRESSED
  2304.                        default is to save COMPRESSED
  2305.           
  2306.       Returns:       - returns 1 if sucessful, otherwise zero.
  2307.  
  2308.  
  2309. ------------------------------------------------ 
  2310.  
  2311.                 ARexx Programmers Intuition & Graphics Library
  2312.                           ( version 1.1 09/21/91 )
  2313.  
  2314.                      
  2315.  
  2316. <>  SET_APIG_GLOBALS()
  2317.  
  2318.     This function initializes many of the global constants used by/in the
  2319.     various Intuition/Graphic data structures and makes them available to
  2320.     your ARexx macro.  Calling this function will modify your ARexx macro
  2321.     environment so that the variables listed below are defined and valued.
  2322.     Of course you could just as well make assignments in your ARexx macro.
  2323.     (any value not listed below you will have to assign in your ARexx pgm)
  2324.  
  2325.  
  2326.     Inputs:   - none 
  2327.  
  2328.  
  2329.     All of the variables listed below are numeric with the 
  2330.     exception of MEMF_CHIP, MEMF_CLEAR, MEMF_FAST, MEMF_PUBLIC.  
  2331.     These four constant are created as 4byte hex-strings in order
  2332.     to be compatiable with the ARexx ALLOCMEM() function.
  2333.  
  2334.       ie.  
  2335.            MEMF_CLEAR  = '10000'x    /* = MEMF_CLEAR               */
  2336.            MEMF_PUBLIC = '10001'x    /* = MEMF_CLEAR + MEMF_PUBLIC */
  2337.            MEMF_CHIP   = '10002'x    /* = MEMF_CLEAR + MEMF_CHIP   */
  2338.            MEMF_FAST   = '10004'x    /* = MEMF_CLEAR + MEMF_FAST   */
  2339.  
  2340.  
  2341.     Also be aware that the use of the 'procedure' keyword in an internal
  2342.     function creates a new symbol table, these variables will not be
  2343.     defined within the procedure unless you also call SET_APIG_GLOBALS 
  2344.     from within the procedure.
  2345.  
  2346.  
  2347.  
  2348.     SET_APIG_GLOBALS creates and sets the following variables:
  2349.  
  2350.  
  2351.     ACTIVATE       ACTIVEWINDOW    ALTKEYMAP   AUTOBACKPEN   AUTODRAWMODE
  2352.     AUTOFRONTPEN   AUTOITEXTFONT   AUTOKNOB    AUTOLEFTEDGE  AUTONEXTTEXT    
  2353.     AUTOTOPEDGE 
  2354.  
  2355.     BACKDROP       BOOLGADGET      BORDERLESS  BOTTOMBORDER
  2356.  
  2357.     CHECKED        CHECKIT         CHECKWIDTH  CLOSEWINDOW   COMMSEQ
  2358.     COMMWIDTH      COMPLEMENT      CUSTOMSCREEN  
  2359.  
  2360.     DELTAMOVE      DISKINSERTED    DISKREMOVED 
  2361.  
  2362.     ENDGADGET 
  2363.  
  2364.     FOLLOWMOUSE    FREEHORIZ       FREEVERT
  2365.  
  2366.     GADGDISABLED   GADGETDOWN      GADGETUP     GADGHBOX     GADGHCOMP
  2367.     GADGHIGHBITS   GADGHIMAGE      GADGHNONE    GADGIMAGE    GADGIMMEDIATE
  2368.     GIMMEZEROZERO  GRELBOTTOM      GRELHEIGHT   GRELRIGHT    GRELWIDTH
  2369.  
  2370.     HAM            HIGHBOX         HIGHCOMP     HIGHFLAGS    HIGHIMAGE
  2371.     HIGHITEM       HIGHNONE        HIRES         
  2372.  
  2373.     IECLASS_EVENT            IECLASS_GADGETDOWN         IECLASS_GADGETUP 
  2374.     IECLASS_NULL             IECLASS_RAWKEY             IECLASS_RAWMOUSE 
  2375.     IECODE_LBUTTON           IECODE_MBUTTON             IECODE_NOBUTTON 
  2376.     IECODE_RBUTTON           IECODE_UP_PREFIX           IEQUALIFIER_CAPSLOCK
  2377.     IEQUALIFIER_CONTROL      IEQUALIFIER_LALT           IEQUALIFIER_LCOMMAND 
  2378.     IEQUALIFIER_LEFTBUTTON   IEQUALIFIER_LSHIFT         IEQUALIFIER_MIDBUTTON 
  2379.     IEQUALIFIER_NUMERICPAD   IEQUALIFIER_RALT           IEQUALIFIER_RBUTTON 
  2380.     IEQUALIFIER_RCOMMAND     IEQUALIFIER_RELATIVEMOUSE  IEQUALIFIER_RSHIFT
  2381.     INACTIVEWINDOW           INTUITICKS                 INVERSVID    
  2382.     ISDRAWN                  ITEMENABLED                ITEMTEXT
  2383.  
  2384.     JAM1           JAM2
  2385.  
  2386.     KNOBHIT
  2387.  
  2388.     LACE           LAYERBACKDROP   LAYERREFRESH    LAYERSIMPLE  LAYERSMART
  2389.     LAYERSUPER     LAYERUPDATING   LEFTBORDER      LONGINT      LOWCHECKWIDTH
  2390.     LOWCOMMWIDTH
  2391.  
  2392.     MAXBODY        MAXPOT          MEMF_CHIP       MEMF_CLEAR   MEMF_FAST
  2393.     MEMF_PUBLIC    MENUDOWN        MENUENABLED     MENUNULL     MENUPICK       
  2394.     MENUTOGGLE     MENUTOGGLED     MENUUP          MENUVERIFY   MOUSEBUTTONS
  2395.     MOUSEMOVE
  2396.  
  2397.     NEWPREFS       NEWSIZE         NOCAREREFRESH   NOISYREQ     NOITEM
  2398.     NOMENU         NOSUB
  2399.  
  2400.     POINTREL       PREDRAWN        PROPBORDERLESS  PROPGADGET
  2401.  
  2402.     RAWKEY         REFRESHWINDOW   RELVERIFY       REPORTMOUSE  REQCLEAR
  2403.     REQSET         REQVERIFY       RIGHTBORDER     RMBTRAP
  2404.  
  2405.     SCREENBEHIND   SCREENQUIET     SELECTDOWN      SELECTED     SELECTUP
  2406.     SHOWTITLE      SIMPLE_REFRESH  SIZEBBOTTOM     SIZEBRIGHT   SIZEVERIFY
  2407.     SMART_REFRESH  STRGADGET       STRINGCENTER    STRINGRIGHT  SUPER_BITMAP
  2408.  
  2409.     TOGGLESELECT   TOPBORDER
  2410.  
  2411.     VANILLAKEY
  2412.  
  2413.     WBENCHMESSAGE  WBENCHSCREEN    WINDOWACTIVE    WINDOWCLOSE 
  2414.     WINDOWDEPTH    WINDOWDRAG      WINDOWREFRESH   WINDOWSIZING
  2415.  
  2416.  
  2417.     eg. after calling SET_APIG_GLOBALS 
  2418.     
  2419.     say "Lace = " lace  
  2420.     
  2421.     should display
  2422.      
  2423.     Lace = 4
  2424.  
  2425.  
  2426. ------------------------------------------------ 
  2427.  
  2428.                 ARexx Programmers Intuition & Graphics Library
  2429.                           ( version 1.1 09/21/91 )
  2430.     
  2431.  
  2432.  
  2433. <>  SETARRAY( arrayptr, arrayindx, value )
  2434.       
  2435.       This function allows you to store 16-bit values into the array
  2436.       pointed to by 'arrayptr'.  Primarily intended for initializing
  2437.       arrays of 16bit integers for functions like LOADRGB(), POLYDRAW(),
  2438.       and MAKEBORDER().
  2439.  
  2440.       
  2441.       Inputs:
  2442.       
  2443.           arrayptr   - pointer to array (block of memory) as returned 
  2444.                        by ARexx ALLOCMEM().  The array should be allocated
  2445.                        in multiples of 2bytes.
  2446.           
  2447.           arrayindx  - numeric, index position you wish to set
  2448.           
  2449.           value      - numeric, value to set position to
  2450.  
  2451.      Returns:        - returns the value the array position was set to.  
  2452.  
  2453.      Also See: SETX(), SETY(), GETX(), GETY(), GETARRAY()
  2454.  
  2455.  
  2456. ------------------------------------------------ 
  2457.  
  2458.  
  2459. <>  SETIMAGE(image,left,top,ppick,ponoff)
  2460.  
  2461.       This function modifies the variables of an Image structure.
  2462.       This allows you to link Images together, so that when they are 
  2463.       drawn they are offset by dx, dy. Otherwise the images would be 
  2464.       displayed one on top of each other.
  2465.       
  2466.       Inputs:
  2467.       
  2468.           image      - pointer to an image structure 
  2469.           
  2470.           left       - numeric, value to set leftedge
  2471.                        use -1 if value is not to be modified
  2472.  
  2473.           top        - numeric, value to set topedge
  2474.                        use -1 if value is not to be modified
  2475.           
  2476.           ppick      - numeric, value to set PlanePick
  2477.                        use -1 if value is not to be modified
  2478.           
  2479.           ponoff     - numeric, value to set PlaneOnOff 
  2480.                        use -1 if value is not to be modified
  2481.           
  2482.           
  2483.       Returns:       - always returns 1
  2484.       
  2485.                      
  2486. ------------------------------------------------ 
  2487.  
  2488.                 ARexx Programmers Intuition & Graphics Library
  2489.                           ( version 1.1 09/21/91 )
  2490.  
  2491.       
  2492. <>  SETSTRGAD( gadgetptr,text )
  2493.  
  2494.       This function sets the value of the string gadget to 'text'
  2495.       You must refresh the gadget to see the new string.
  2496.       
  2497.       
  2498.       Inputs:
  2499.       
  2500.           gadgetptr  - pointer to a string gadget
  2501.           
  2502.           text       - text string to be stored in the string gadget
  2503.                        Note to clear a string gadget use a empty string
  2504.                        using double quotes.
  2505.                        
  2506.                        eg.  x = SETSTRGAD(mygad,"")  THIS
  2507.       
  2508.                             x = SETSTRGAD(mygad,0)   NOT this
  2509.                                 this puts the character '0' in the gadget
  2510.  
  2511.  
  2512.      Returns:        - returns the length of the string installed in the
  2513.                        string gadget buffer.  This should be the length
  2514.                        of the 'text' you specified.  If the length of
  2515.                        the 'text' is greater than the max chars the string 
  2516.                        gadget buffer can hold, then (maxchars - 1) are
  2517.                        placed in the buffer.
  2518.  
  2519.  
  2520. ------------------------------------------------ 
  2521.  
  2522.                 ARexx Programmers Intuition & Graphics Library
  2523.                           ( version 1.1 09/21/91 )
  2524.  
  2525.  
  2526.  
  2527. <>  SETVALUE(ptr,offset,size,type,value,len)
  2528.  
  2529.       This function allows you to set the value of any parameter in
  2530.       any data structure.  Please be very certain about the parameters you
  2531.       use in this function. (If you're gonna shoot yourself in the foot
  2532.       this is the gun to do it with.)
  2533.    
  2534.       ptr    - pointer, (ARexx hex string) to any data structure, ie. window
  2535.                screen, bitmap, etc.
  2536.    
  2537.       offset - numeric, specifies the relative position, from the beginning
  2538.                of the data structure, of the data value you want to set.
  2539.                (see RKM or include '.i' files for offsets)
  2540.    
  2541.       size   - numeric, specifies the size of the data value you want to
  2542.                set.  This value must be either 1, 2, or 4.  Any other
  2543.                value will cause the function to return a NULL.
  2544.                (ie. '0000 0000'x).
  2545.                
  2546.       type   - string, either a 'N', 'P' or 'S', this specifies the form 
  2547.                of the data 'value' you are passing.
  2548.    
  2549.                'N' specifies that the value is a numeric.
  2550.                    for sizes of 1 and 2 the value is always taken (assumed)
  2551.                    to be a numeric.
  2552.    
  2553.                If the size is 4 then you can also use (in addition to 'N')
  2554.                the following:
  2555.    
  2556.                'P' specifies that the value you are passing is a pointer.
  2557.                    (ie. ARexx hex string)
  2558.    
  2559.                'S' specifies that the value you are passing is a string.
  2560.    
  2561.                    VERY IMPORTANT NOTE !!! 
  2562.                    When using 'P' or 'S',  'ptr' + 'offset' must result 
  2563.                    in an address which contains a pointer to something.
  2564.    
  2565.    
  2566.       len    - numeric, used in conjuction with type 'S', this specifies
  2567.                the maximum number of characters to be moved into the 
  2568.                area pointed to by the pointer at 'ptr' + 'offset'.  
  2569.                If you specify -1 the entire string will be copied into the 
  2570.                area pointed to by the pointer.
  2571.                
  2572.                eg.  You can set the window title string with:
  2573.                
  2574.                     x = setvalue(windowpointer,32,4,'S',"MY NEW TITLE",-1)
  2575.    
  2576.                     This statement DIRECTLY modifies the contents of the
  2577.                     buffer pointed to by the window title pointer.
  2578.                     
  2579.                     
  2580.               The proper thing to do would be to modify where the window 
  2581.               title pointer points.
  2582.    
  2583.               eg. 
  2584.                   mynewtitle = ALLOCMEM(length("MY NEW TITLE")+1,'0001 0000'x)
  2585.    
  2586.                   call EXPORT(mynewtitle,"MY NEW TITLE")
  2587.    
  2588.                   x = setvalue(windowpointer,32,4,'P',mynewtitle,0)
  2589.                   
  2590.    
  2591.          returns -  1 if succesful, otherwise 0 
  2592.  
  2593.  
  2594. ------------------------------------------------ 
  2595.  
  2596.                 ARexx Programmers Intuition & Graphics Library
  2597.                           ( version 1.1 09/21/91 )
  2598.  
  2599.  
  2600. <>  SETX( arrayptr,xindex,value ) 
  2601.       
  2602.       This function does the same as SETARRAY(), the difference is that
  2603.       it computes the index offset value for X-pair for you.
  2604.       
  2605.       Inputs:
  2606.       
  2607.           arrayptr   - pointer to array as returned by ARexx ALLOCMEM().
  2608.           
  2609.           xindex     - numeric, index position you wish to set 
  2610.           
  2611.           value      - numeric, value to set position to 
  2612.  
  2613.      Returns:        - returns the value the array position was set to. 
  2614.  
  2615.       
  2616. ------------------------------------------------ 
  2617.  
  2618.  
  2619. <>  SETY( arrayptr,yindex,value )
  2620.       
  2621.       This function does the same as SETARRAY(), the difference is that
  2622.       it computes the index offset value for Y-pair for you.
  2623.       
  2624.       Inputs:
  2625.       
  2626.           arrayptr   - pointer to array as returned by ARexx ALLOCMEM().
  2627.           
  2628.           yindex     - numeric, index position you wish to set  
  2629.           
  2630.           value      - numeric, value to set position to  
  2631.  
  2632.      Returns:        - returns the value the array position was set to.  
  2633.  
  2634.  
  2635. ------------------------------------------------ 
  2636.  
  2637. <>  VERTPOT(gadgeptr)
  2638.  
  2639.       This function returns the value of the vertical component of the
  2640.       pot gadget.
  2641.       
  2642.       Inputs:
  2643.       
  2644.           gadgetptr  - pointer to a proportional gadget, return from 
  2645.                        MAKEPROPGADGET().
  2646.           
  2647.      Returns:        - returns the numeric value of VertPot
  2648.  
  2649.  
  2650. ------------------------------------------------ 
  2651.  
  2652.                 ARexx Programmers Intuition & Graphics Library
  2653.                           ( version 1.1 09/21/91 )
  2654.  
  2655.  
  2656. <>  TICKFREQUENCY(window,N)
  2657.  
  2658.       This function allows you to specify how often you want to receive
  2659.       INTUITICK messages from INTUITION.  The task managing the windows
  2660.       IDCMP builds an ARexx message for the INTUITICK event it receives,
  2661.       and immediately replies to INTUITION, afterwhich it then sends the
  2662.       ARexx message packet to you.  The rate at which INTUITION sends 
  2663.       INTUITICKS is about 10 times per sec, which might be faster than 
  2664.       your ARexx macro can keep up with.  This function will cause the 
  2665.       task to 'swallow' every 'Nth' INTUITICK message.
  2666.       
  2667.       Inputs:
  2668.       
  2669.           window    - pointer to window opened with OPENWINDOW().
  2670.           
  2671.           N         - frequency at which INTUITICKS should be sent to you
  2672.           
  2673.       eg.  x = tickfrequency(window,50)
  2674.            will cause you to receive every 50th INTUITICK message.
  2675.            (approx. one every 5 seconds)
  2676.            
  2677.       eg.  x = tickfrequency(window,1)
  2678.            will get you all INTUITICK messages.
  2679.            
  2680.            specifing a value of zero will default to 1.
  2681.            
  2682.            When a window is initially opened its tickfrequency is 20.
  2683.            
  2684.       Returns:      - returns N, the value you specified.
  2685.  
  2686.  
  2687. ------------------------------------------------ 
  2688.  
  2689.  
  2690. <>  USEIFFCOLOR(pointer,scr)
  2691.  
  2692.       This functions sets the screens color registers to the colors
  2693.       contained in the 'CMAP' chunk of the IFF.  If the IFF has no
  2694.       CMAP then no change is made to the screen colors.
  2695.       
  2696.       Inputs:
  2697.       
  2698.           pointer    - pointer to a IFF bitmap (returned by LOADIFF()).
  2699.                        This must be the original bitmap pointer 
  2700.                        (or copy of it) returned by the LOADIFF() function. 
  2701.                        You cannot use a pointer returned by MAKEBITMAP() 
  2702.                        into which you have blitted the IFF.
  2703.           
  2704.           scr        - pointer to a screen opened with OPENSCREEN()
  2705.  
  2706.       Returns:       - does a LOADRGB() of the IFF colors into the screen
  2707.                        and returns 1 if successful.
  2708.                        returns 0 if not a pointer to IFF or if the IFF 
  2709.                        does not contain a CMAP chunk.
  2710.  
  2711.  
  2712. ------------------------------------------------ 
  2713.  
  2714.                 ARexx Programmers Intuition & Graphics Library
  2715.                           ( version 1.1 09/21/91 )
  2716.  
  2717.  
  2718. <>  WINDOWINFO(window,code)
  2719.  
  2720.       This function returns various values from the window structure.
  2721.       
  2722.       Inputs:
  2723.       
  2724.           window   - pointer to window opened with OPENWINDOW().
  2725.           
  2726.           code     - numeric, code which specifies which value from the
  2727.                      window structure you would like.
  2728.                      
  2729.                      The code values are:
  2730.                      
  2731.                        CODE       Returns
  2732.                      ---------  ---------------------------  
  2733.                         1         Windows Left Edge value
  2734.                         2         Windows Top Edge value
  2735.                         3         Windows Width  value
  2736.                         4         Windows Height value
  2737.                         5         Windows MouseY value
  2738.                         6         Windows MouseX value
  2739.                         7         Windows MinWidth value
  2740.                         8         Windows MinHeight value
  2741.                         9         Windows MaxWidth value
  2742.                         10        Windows MaxHeight value
  2743.                         11        Windows Flags value
  2744.                         12        Windows Requester count value
  2745.                         13        Windows Border Left value
  2746.                         14        Windows Border Top value
  2747.                         15        Windows Border Right value
  2748.                         16        Windows Border Bottom value
  2749.                         17        Windows IDCMP Flags value
  2750.                         18        Windows Detail Pen value
  2751.                         19        Windows Block Pen value
  2752.                         20        Windows GZZMouseX value
  2753.                         21        Windows GZZMouseY value
  2754.                         22        Windows GZZWidth value
  2755.                         23        Windows GZZHeight value
  2756.  
  2757.  
  2758. ------------------------------------------------ 
  2759.  
  2760.  
  2761. <>  WINTASKNAME(window)
  2762.  
  2763.     This function returns the name of the task managing the windows 
  2764.     IDCMP port.  This is also the name of the public message port 
  2765.     for the window.
  2766.      
  2767.       Inputs:
  2768.       
  2769.           window  - pointer to a window opened with OPENWINDOW().
  2770.                  
  2771.        
  2772.       Returns:    - window task name string, ie. 'apig.task.N'
  2773.                      
  2774.  
  2775. ------------------------------------------------ 
  2776.  
  2777.                 ARexx Programmers Intuition & Graphics Library
  2778.                           ( version 1.1 09/21/91 )
  2779.  
  2780.  
  2781. <>  WRITECONSOLE(window,text)
  2782.  
  2783.       This function writes the text to console of the window.  
  2784.       The window must have been opened with a console attached.
  2785.       
  2786.       Inputs:
  2787.       
  2788.           window   - pointer to window opened with OPENWINDOW().
  2789.           
  2790.           text     - text string to be written to console.
  2791.           
  2792.       Returns:     - the number of characters written to the console.
  2793.  
  2794.                 ARexx Programmers Intuition & Graphics Library
  2795.                           ( version 1.1  09/21/91 )
  2796.  
  2797.  
  2798.                          Graphics Library Functions 
  2799.  
  2800.  
  2801.  After parameter conversion the following functions result in a 
  2802.  direct call to the Amiga Graphic Library function of the same
  2803.  name.  Please refer to your favorite Amiga reference book(s) for
  2804.  a detailed description.
  2805.  
  2806.                          
  2807.  
  2808. <>  AREACIRCLE(rp,cx,cy,radius)
  2809.   
  2810. <>  AREADRAW(rp,x,y)
  2811.  
  2812. <>  AREAELLIPSE(rp,cx,cy,a,b)
  2813.  
  2814. <>  AREAEND(rp)
  2815.  
  2816. <>  AREAMOVE(rp,x,y)
  2817.  
  2818. <>  BLTBITMAP(srcbm,srcx,srcy,dstbm,dstx,dsty,sizex,sizey,minterm,
  2819.                                                           mask,tempa)
  2820.  
  2821. <>  BLTBITMAPRASTPORT(srcbm,srcx,srcy,rp,destx,desty,sizex,sizey,minterm)
  2822.   
  2823. <>  BLTCLEAR(memblock,bytecount,flags)
  2824.  
  2825. <>  BLTMASKBITMAPRASTPORT(scrbm,srcx,srcy,rp,destx,desty,sizex,sizey,
  2826.                                                      minterm,bltmask)
  2827.  
  2828. <>  BLTPATTERN(rp,mask,x1,y1,x2,y2,bytecnt)
  2829.  
  2830. <>  BLTTEMPLATE(srctemplate,srcx,srcmod,rp,dstx,dsty,sizex,sizey)
  2831.  
  2832. <>  CLEAREOL(rp,x,y)
  2833.  
  2834.         Note: 
  2835.         The Amiga Graphics library function has one argument.
  2836.         X,Y (starting pixel position) are included in this 
  2837.         call to mark where the clearing should start from.
  2838.  
  2839. <>  CLEARSCREEN(rp,x,y)
  2840.  
  2841.         Note: 
  2842.         The Amiga Graphics library function has one argument.
  2843.         X,Y are included in this call to mark where the 
  2844.         clearing should start from.
  2845.  
  2846. <>  CLIPBLIT(srcrp,srcx,srcy,destrp,destx,desty,xsize,ysize,minterm)
  2847.   
  2848. <>  DRAW(rp,x,y)
  2849.  
  2850. <>  DRAWCIRCLE(rp,cx,cy,r)
  2851.  
  2852. <>  DRAWELLIPSE(rp,cx,cy,a,b)
  2853.  
  2854. <>  FLOOD(rp,mode,x,y)
  2855.  
  2856. <>  INITAREA - see MAKEAREA function
  2857.  
  2858. <>  INITBITMAP - see MAKEBITMAP function
  2859.  
  2860. <>  INITRASTPORT - see MAKERASTPORT function
  2861.  
  2862. <>  LOADRGB4(screen,arrayptr,count)
  2863.  
  2864. <>  MOVE(rp,x,y)
  2865.  
  2866. <>  OPENFONT(textAttr)
  2867.      Note: textAttr is obtained from MAKETATTR()
  2868.  
  2869. <>  POLYDRAW(rp,count,array)
  2870.  
  2871. <>  READPIXEL(rp,x,y)
  2872.  
  2873. <>  RECTFILL(rp,xmin,ymin,xmax,ymax)
  2874.  
  2875. <>  SCROLLRASTER(rp,dx,dy,xmin,ymin,xmax,ymax)
  2876.  
  2877. <>  SETAFPT(rp,pattern,patternsize)
  2878.  
  2879. <>  SETAPEN(rp,pen)
  2880.  
  2881. <>  SETBPEN(rp,pen)
  2882.  
  2883. <>  SETDRMD(rp,mode)
  2884.  
  2885. <>  SETDRPT(rp,linepattern)
  2886.  
  2887. <>  SETFONT(rp,font)
  2888.  
  2889. <>  SETOPEN(rp,pen)
  2890.  
  2891. <>  SETRAST(rp,pen)
  2892.  
  2893. <>  SETRGB4(screen/window,pen,r,g,b)
  2894.       Note:
  2895.       This function does the same as SETRGB4() but the parameters are
  2896.       different. The first parameter is a pointer to a screen or window.
  2897.         
  2898.  
  2899. <>  SETSOFTSTYLE(rp,style,enable)
  2900.  
  2901. <>  SETWRMSK(rp,wrtmask)
  2902.  
  2903. <>  TEXT(rp,string,count)
  2904.       Note:
  2905.       If the count parameter is less than zero, then the
  2906.       length of the string will be computed for you.
  2907.       eg.  call TEXT(rp,string,-1), the length of string is computed for you
  2908.            (string must be null terminated)
  2909.       
  2910. <>  TEXTLENGTH(rp,string,count)
  2911.       Note:
  2912.       If the count parameter is less than zero, then the
  2913.       length of the string will be computed for you.
  2914.       (string must be null terminated)
  2915.   
  2916.  
  2917. <>  WRITEPIXEL(rp,x,y)
  2918.                 ARexx Programmers Intuition & Graphics Library
  2919.                           ( version 1.1  09/21/91 )
  2920.  
  2921.  
  2922.                          Intuition Library Functions 
  2923.  
  2924.  
  2925.  After parameter conversion the following functions result in a 
  2926.  direct call to the Amiga Intuition Library function of the same
  2927.  name.  Please refer to your favorite Amiga reference book(s) for
  2928.  a detailed description.
  2929.  
  2930.  
  2931. <>  ACTIVATEGADGET(gadget,window,requester)
  2932.  
  2933. <>  ACTIVATEWINDOW(window)
  2934.  
  2935. <>  ADDGADGET(window,gadget,position)
  2936.  
  2937. <>  ADDGLIST(window,gadget,position,numgad,requester)
  2938.  
  2939. <>  AUTOREQUEST(window,itext,itext,itext,posflags,newflags,width,hgt)
  2940.   
  2941.       Note: This function does not return until the requester is 
  2942.             satisfied.  Only one requester can be put up at a time.
  2943.             
  2944.  
  2945. <>  BEGINREFRESH(window)
  2946.  
  2947. <>  CLEARDMREQUEST(window)
  2948.  
  2949. <>  CLEARMENUSTRIP(window)
  2950.  
  2951.       Note: APIG library will call CLEARMENUSTRIP() before 
  2952.             closing a window.  The library will also call 
  2953.             CLEARMENUSTRIP() before setting a new menu strip.
  2954.             You will need this function however if you set a
  2955.             menustrip, but then later want to remove the menu
  2956.             without setting a new one. (ie. no menus displayed)
  2957.             
  2958.                          
  2959. <>  CLEARPOINTER(window)
  2960.  
  2961. <>  CLOSESCREEN(screen)
  2962.      APIG will refuse to close a screen if a window is still open.
  2963.      APIG will refuse to close a screen that it did not open.
  2964.  
  2965. <>  CLOSEWINDOW(window)
  2966.      APIG will refuse to close a window that it did not open.
  2967.      
  2968. <>  DISPLAYBEEP(screen)
  2969.  
  2970. <>  DOUBLECLICK(startsecs,startmicros,currentsecs,currentmicros)
  2971.   
  2972. <>  DRAWBORDER(rp,border,leftoffset,topoffset)
  2973.  
  2974. <>  DRAWIMAGE(rp,image,leftoffset,topoffset)
  2975.   
  2976. <>  ENDREFRESH(window,complete)
  2977.  
  2978. <>  ENDREQUEST(requester,window)
  2979.  
  2980. <>  GETDEFPREFS(prefbuffer,size)
  2981.  
  2982. <>  GETPREFS(prefbuffer,size)
  2983.  
  2984. <>  GETSCREENDATA(buffer,size,type,screen)
  2985.  
  2986. <>  ITEMADDRESS(menustrip,menunumber)
  2987.   
  2988. <>  ITEMNUM(menunumber)
  2989.  
  2990. <>  INITREQUESTER - see MAKEREQUESTER 
  2991.  
  2992. <>  INTUITEXTLENGTH(itext)
  2993.  
  2994. <>  MENUNUM(menunumber)
  2995.  
  2996. <>  MODIFYIDCMP(window,idcmpflags)
  2997.  
  2998. <>  MODIFYPROP(gadget,window,requester,flags,hpot,vpot,hbody,vbody)
  2999.  
  3000. <>  NEWMODIFYPROP(gadget,window,requester,flags,hpot,vpot,hbody,vbody,
  3001.                                                                 numgad)
  3002.  
  3003. <>  MOVESCREEN(screen,deltax,deltay)
  3004.  
  3005. <>  MOVEWINDOW(window,deltax,deltay)
  3006.  
  3007. <>  OFFGADGET(gadget,window,requester)
  3008.  
  3009. <>  OFFMENU(window,menunumber)
  3010.  
  3011. <>  ONGADGET(gadget,window,requester)
  3012.  
  3013. <>  ONMENU(window,menunumber)
  3014.  
  3015. <>  PRINTITEXT(rp,itext,leftoffset,topoffset)
  3016.  
  3017. <>  REFRESHGADGETS(gadgets,window,requester)
  3018.  
  3019. <>  REFRESHGLIST(gadgets,window,requester,numgad)
  3020.  
  3021. <>  REFRESHWINDOWFRAME(window)
  3022.  
  3023. <>  REMOVEGADGET(window,gadget)
  3024.  
  3025. <>  REMOVEGLIST(window,gadget,numgad)
  3026.  
  3027. <>  REPORTMOUSE(boolean,window)
  3028.  
  3029.                 ARexx Programmers Intuition & Graphics Library
  3030.                           ( version 1.1 09/21/91 )
  3031.  
  3032.  
  3033. <>  REQUEST(requester,window)
  3034.  
  3035.       This function unlike the AUTOREQUEST() function, returns immediately.
  3036.       In v1.1 of APIG multiple requesters can be put up.
  3037.  
  3038.       This function will return 1 if the requester was successfully put
  3039.       up in the window, else it returns 0.
  3040.       
  3041.       If successful you should then enter a loop to receive messages from
  3042.       the window task.  The IDCMP of the window will have been modified, 
  3043.       you will get your normal IDCMP messages in addition to GADGETDOWN, 
  3044.       GADGETUP, REQCLEAR and REQSET messages.
  3045.       When the requester is satisfied, the IDCMP will be restored.
  3046.       
  3047.       eg.  after building a requester
  3048.       
  3049.            reqputup = request(myrequester,mywindow)
  3050.            if reqputup = 1 then   /* if result is 1 request successful */
  3051.               do                 /* else requester was not put up     */
  3052.                   exitme = 0      
  3053.                   do forever
  3054.                   
  3055.                      if exitme = 1 then leave
  3056.                      
  3057.                      x = waitpkt(portname)
  3058.                      
  3059.                      do forever
  3060.                         msg = getpkt(portname)
  3061.                         if msg = '0000 0000'x then leave
  3062.                         class  = getarg(msg,0)
  3063.                         
  3064.                         if class = REQCLEAR then exitme = 1
  3065.                         
  3066.                         if class = GADGETDOWN then 
  3067.                            do
  3068.                               gadid = getarg(msg,9)
  3069.                               if gadid = mygadgetid1 then 
  3070.                               do
  3071.                                  x = dosomething1()
  3072.                                  exitme = 1
  3073.                               end   
  3074.                            end
  3075.                            
  3076.                         if class = GADGETUP then 
  3077.                            do
  3078.                               gadid = getarg(msg,9)
  3079.                               if gadid = mygadgetid2 then 
  3080.                               do
  3081.                                  x = dosomething2()
  3082.                                  exitme = 1
  3083.                               end   
  3084.                            end
  3085.                            
  3086.                         x = replymsg(msg,0)
  3087.                            
  3088.                      end
  3089.                   end
  3090.               end
  3091.  
  3092.                 ARexx Programmers Intuition & Graphics Library
  3093.                           ( version 1.1 09/21/91 )
  3094.  
  3095.  
  3096.  
  3097. <>  SCREENTOBACK(screen)
  3098.   
  3099. <>  SCREENTOFRONT(screen)
  3100.  
  3101. <>  SETDMREQUEST(window,dmrequester)
  3102.  
  3103. <>  SETMENUSTRIP(window,menu)
  3104.  
  3105.       Note: APIG library keeps track of whether a menu 
  3106.             strip has been attached to a window.  Therefore
  3107.             you can call SETMENUSTRIP() multiple times without 
  3108.             having to precede it with a CLEARMENUSTRIP() call.
  3109.             The library will call CLEARMENUSTRIP() for you if
  3110.             it sees that a menu is still attached to the window.
  3111.             It will also call CLEARMENUSTRIP() before closing
  3112.             a window as well.
  3113.                          
  3114.  
  3115. <>  SETPOINTER(window,pointer,height,width,xoffset,yoffset)
  3116.  
  3117. <>  SETPREFS(prefbuffer,size,inform)
  3118.  
  3119. <>  SETWINDOWTITLE(window,widnowtitle,screentitle)
  3120.  
  3121. <>  SHOWTITLE(screen,showit)
  3122.  
  3123. <>  SIZEWINDOW(window,deltax,deltay)
  3124.  
  3125. <>  SUBNUM(menunumber)
  3126.  
  3127. <>  WBENCHTOBACK()
  3128.  
  3129. <>  WBENCHTOFRONT()
  3130.  
  3131. <>  WINDOWLIMITS(window,minwidth,minheight,maxwidth,maxheight)
  3132.  
  3133. <>  WINDOWTOBACK(window)
  3134.  
  3135. <>  WINDOWTOFRONT(window)
  3136.  
  3137.  
  3138.                 ARexx Programmers Intuition & Graphics Library
  3139.                           ( version 1.1  09/21/91 )
  3140.  
  3141.  
  3142.  
  3143.                          Layers Library Functions
  3144.  
  3145.  After parameter conversion the following functions result in a 
  3146.  direct call to the Amiga Layers Library function of the same name.
  3147.  Please refer to your favorite Amiga reference book(s) for a detailed
  3148.  description.
  3149.  
  3150.  
  3151.  
  3152. <>  BEHINDLAYER(layer)
  3153.       Note that only one parameter is used.
  3154.       layer - is a pointer to a layer structure
  3155.  
  3156.  
  3157. <>  CREATEBEHINDLAYER(windowpointer,x0,y0,x1,y1,flags,bm2)
  3158.       Note that a window pointer (obtained from OPENWINDOW()) is used
  3159.       instead of the parameters layerinfo and bitmap as described in 
  3160.       the RKM manual.
  3161.       The layerinfo and bitmap pointers are obtained from the window
  3162.       parameter, all other parameters are as described in RKM.
  3163.  
  3164.  
  3165. <>  CREATEUPFRONTLAYER(windowpointer,x0,y0,x1,y1,flags,bm2) 
  3166.       Note that a window pointer (obtained from OPENWINDOW()) is used
  3167.       instead of the parameters layerinfo and bitmap as described in 
  3168.       the RKM manual.
  3169.       The layerinfo and bitmap pointers are obtained from the window
  3170.       parameter, all other paramenters are as described in RKM.
  3171.       
  3172.  
  3173. <>  DELETELAYER(layer)
  3174.       Note that only one parameter is used.
  3175.       layer - is a pointer to a layer structure
  3176.  
  3177.  
  3178. <>  MOVELAYERINFRONTOF(layertomove,targetlayer)
  3179.  
  3180.  
  3181. <>  MOVELAYER(layer,dx,dy)
  3182.       Note that only three parameters are used.
  3183.       layer - is a pointer to a layer structure
  3184.  
  3185.  
  3186. <>  SCROLLLAYER(layer,dx,dy)
  3187.       Note that only three parameters are used.
  3188.       layer - is a pointer to a layer structure
  3189.  
  3190.  
  3191. <>  SIZELAYER(layer,dx,dy)
  3192.       Note that only three parameters are used.
  3193.       layer - is a pointer to a layer structure
  3194.  
  3195.  
  3196. <>  UPFRONTLAYER(layer)
  3197.       Note that only one parameter is used.
  3198.       layer - is a pointer to a layer structure
  3199.  
  3200.                 ARexx Programmers Intuition & Graphics Library
  3201.                           ( version 1.1  09/21/91 )
  3202.  
  3203.  
  3204.  
  3205.                          Exec Library Functions
  3206.  
  3207.  
  3208.  After parameter conversion the following functions result in a 
  3209.  direct call to the Amiga Exec Library function of the same name.
  3210.  Please refer to your favorite Amiga reference book(s) for a 
  3211.  detailed description.
  3212.  
  3213.  
  3214.      When using the list functions, parameters are allocated from 
  3215.      system memory using the ARexx function ALLOCMEM().  Be sure 
  3216.      that you allocate at least as much memory required for the list
  3217.      or node data structure.
  3218.  
  3219.  
  3220. <>  ADDHEAD(list,node)
  3221.  
  3222. <>  ADDTAIL(list,node)
  3223.  
  3224. <>  ENQUEUE(list,node)
  3225.  
  3226. <>  INSERTNODE(list,node,listnode)   
  3227.         Note name differs, since ARexx has function with the name INSERT().
  3228.  
  3229. <>  NEWLIST(list)
  3230.  
  3231. <>  REMHEAD(list)
  3232.  
  3233. <>  REMOVE(node)
  3234.  
  3235. <>  REMTAIL(list)
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.                    APIG Library List related functions.
  3242.  
  3243.  
  3244.     You may find these functions useful when working with Exec list     
  3245.     structures.
  3246.  
  3247.  
  3248. <>  EMPTYLIST(list) - returns 1, if the list is empty, else returns 0
  3249.  
  3250. <>  LISTEMPTY(list) - same as EMPTYLIST()
  3251.  
  3252. <>  FIRSTNODE(list,node) - returns 1 if the node is first node in the list
  3253.                             else returns 0.
  3254.  
  3255. <>  LASTNODE(list,node)  - returns 1 if the node is the last node in the list
  3256.                             else returns 0.
  3257.  
  3258.                 ARexx Programmers Intuition & Graphics Library
  3259.                           ( version 1.1 09/21/91 )
  3260.    
  3261.  
  3262.  Some Menu Hints
  3263.  
  3264.  
  3265.     Menu Text
  3266.  
  3267.           You will find that using pre-constructed IntuiText allows for 
  3268.           better placement of the menu/item/subitem text.  When menu text 
  3269.           is specified in the make... call APIG builds a simple IntuiText
  3270.           structure.
  3271.  
  3272.           Using pre-constructed IntuiText, you could make the select 
  3273.           box as large as you like and place the text anywhere within
  3274.           the select box (since the IntuiText will be relative to its
  3275.           containing menu/item/subitem select box.  
  3276.  
  3277.           eg.
  3278.           
  3279.             instead of this
  3280.           
  3281.             (1)   myitem = makeitem(w,"My Item Text",...,0,0)
  3282.  
  3283.             do this
  3284.  
  3285.                   myitemIntuiText = makeitext(w,'My Item Text',...)
  3286.             (2)   myitem = makeitem(w,"",...,0,myitemIntuiText)
  3287.  
  3288.                   (dont forget that the IntuiText can be linked too!)
  3289.                   (allowing multiple text be displayed for a single menu)
  3290.  
  3291.             Form (1) allows you to quickly get the menu structure/layout 
  3292.             built, afterwhich you can go back and fill in the details with 
  3293.             pre-constructed IntuiText, form (2).
  3294.  
  3295.  
  3296.  
  3297.     The 'top' parameter
  3298.  
  3299.  
  3300.             It is the value of 'top' that allows you to 
  3301.             position items/subitems on the same line.
  3302.  
  3303.             eg. 
  3304.                makeitem(w,'AA',m,0,0,... )
  3305.                makeitem(w,'AB',m,0,0,... )
  3306.                makeitem(w,'AC',m,x,65536,... )
  3307.                makeitem(w,'AD',m,x,0,... )
  3308.  
  3309.                would produce
  3310.  
  3311.              +------------------------+
  3312.              |  AA item       AC item |
  3313.              |  AB item       AD item |
  3314.              +------------------------+
  3315.  
  3316.              the 'top' value of 65536 (mod(top,65536) = 0 )
  3317.              will cause the top edge of of item AC to
  3318.              be measured from zero. The item AD is measured
  3319.              from the item which precedes it, which is item AC, 
  3320.              AD has a 'top' value of 0, therefore it is 
  3321.              measured from the bottom of AC.  If AD had a
  3322.              non-zero 'top' value < 65536 then the menu would
  3323.              look something like this
  3324.  
  3325.  
  3326.              +------------------------+
  3327.              |  AA item       AC item |
  3328.              |  AB item               | <---
  3329.              |                        |  AD top pixels (ADtop < 65536)
  3330.              |                        |
  3331.              |                AD item | <---
  3332.              +------------------------+
  3333.  
  3334.              there are 'ADtop' number of pixels between
  3335.              the BOTTOM of AC and the top of item AD.
  3336.  
  3337.  
  3338.              if item 'ADtop' value were negative then their
  3339.              would be 'ADtop' number of pixels between
  3340.              the TOP of AC and the top of item AD.
  3341.  
  3342.              +------------------------+ <---
  3343.              |  AA item       AC item |
  3344.              |  AB item               | 
  3345.              |                        |  AD top pixels
  3346.              |                        |
  3347.              |                AD item | <---
  3348.              +------------------------+
  3349.  
  3350.  
  3351.              Note you must shift the items over 'x' 
  3352.              number of pixels so that AC does overlay
  3353.              item AA.
  3354.  
  3355.  
  3356.  
  3357.              If item AC had a 'top' value > 65536 then the
  3358.              menu would look something like this
  3359.  
  3360.              +------------------------+ <--- 
  3361.              |  AA item               |      mod(ACtop,65536)
  3362.              |  AB item               |      pixels
  3363.              |                AC item | <---
  3364.              |                        |
  3365.              |                        |
  3366.              |                        |
  3367.              |                AD item |
  3368.              +------------------------+
  3369.  
  3370.  
  3371.              item AD will still be measured relative to the one
  3372.              that precedes, ie. item AC.
  3373.  
  3374.  
  3375.  
  3376.             If both item AC and AD had top values >= 65536
  3377.             then the menu might look something like below
  3378.             depending on the 'top' values for items AC and AD.
  3379.  
  3380.              +--------------------------------+
  3381.              |  AA item   AC item    AD item  |
  3382.              |  AB item                       |
  3383.              |                                |
  3384.              +--------------------------------+
  3385.  
  3386.                  or this
  3387.  
  3388.              +--------------------------------+
  3389.              |  AA item   AC item             |
  3390.              |  AB item                       |
  3391.              |                                |
  3392.              |                       AD item  |
  3393.              +--------------------------------+
  3394.  
  3395.  
  3396.  
  3397.     The 'height' parameter
  3398.    
  3399.             The 'height' parameter determines how tall the select box is, 
  3400.             for sub-items you will want the select boxes to be close 
  3401.             together, so that the menu layer is not re-drawn as you move
  3402.             from sub-item to sub-item.  
  3403.             If your sub-items flicker/jump/wiggle or whatever you call it,
  3404.             then you probably will want to adjust the height parameter.
  3405.  
  3406.                 ARexx Programmers Intuition & Graphics Library
  3407.                           ( version 1.1  09/21/91 )
  3408.  
  3409.  
  3410.  
  3411.      A little about APIG pointers.
  3412.  
  3413.      In version 0.5 APIG simply returned a pointer (ACTUAL address) to 
  3414.      the allocated structure, APIG knew nothing about the pointer or
  3415.      what it pointed to.  In fact one could simply hand hardcode a
  3416.      block of memory for a particular structure and APIG 0.5 would 
  3417.      use it.
  3418.  
  3419.      In version 1.1 APIG verifies that the pointer you passed in a 
  3420.      function call, points to a structure of the appropriate type.
  3421.      It does this by storing information about the pointer at negative
  3422.      offsets, similar to ARexx argstrings.
  3423.  
  3424.      ALL pointers returned (made) by APIG have the following information 
  3425.      stored at negative offsets from the pointer:
  3426.  
  3427.      format 1: APIGTAG
  3428.  
  3429.         contents | $4AFA | ptr | type | structure memory block |
  3430.         offset   |  -8   | -6  |  -2  |
  3431.         size     |   2   |  4  |   2  |
  3432.                                       ^ APIG gives you this addr
  3433.  
  3434.         $4AFA - 2bytes Motorola says this will be illegal/trap forever
  3435.         ptr   - 4bytes address of structure (points back to the structure)
  3436.         type  - 2bytes numeric type of data structure allocated by APIG
  3437.  
  3438.      APIG will check the validity of all pointers passed to it and return
  3439.      (fail) if it is not formatted as above.
  3440.  
  3441.  
  3442.      If the allocated structure is a BitMap or RastPort allocated with
  3443.      MAKEBITMAP/MAKERASTPORT or a bitmap/image loaded with LOADIFF or
  3444.      LOADIMAGE then the following format is used.
  3445.  
  3446.      format 2: APIGTAG
  3447.  
  3448.         contents | bmhdr | $4AFA | ptr | type | structure memory block |
  3449.         offset   |  -12  |  -8   | -6  |  -2  |
  3450.         size     |   4   |   2   |  4  |   2  |
  3451.                                               ^ APIG gives you this addr
  3452.  
  3453.         bmhdr - 4bytes, points to the IFF BMHD header that was loaded
  3454.                 with the IFF bitmap/image by iff.library.  If the 
  3455.                 APIG IFF functions do not provide all the information
  3456.                 you need, you can use GETVALUE() with proper offsets to 
  3457.                 get the information from the BMHD itself.
  3458.                 (See bmhdr format below)
  3459.  
  3460.         The IFF functions, eg. USEIFFCOLOR, do check the validity of 
  3461.         the 'bmhdr' pointer.
  3462.  
  3463.                 ARexx Programmers Intuition & Graphics Library
  3464.                           ( version 1.1 09/21/91 )
  3465.  
  3466.  
  3467.         If MAKEBITMAP/MAKERASTPORT were used to create the pointer then
  3468.         the 'bmhdr' pointer will be NULL.  
  3469.         
  3470.         Any function that uses a bitmap/rastport pointer, will NOT check 
  3471.         for validity, since you can grab a bitmap/rastport from any 
  3472.         window/screen/layer.
  3473.  
  3474.         
  3475.      The following are the current values used for 'type' at offset -2,
  3476.      use these values with the MAKESTRUCT/MAKEPOINTER functions.
  3477.  
  3478.      Type 
  3479.  
  3480.       00  = just a block of memory
  3481.       15  = Gadget (bool/string/prop)
  3482.       21  = IntuiText
  3483.       27  = Requester
  3484.       33  = Border
  3485.       39  = Bitmap
  3486.       45  = Rastport
  3487.       51  = Image
  3488.       57  = Menu
  3489.       63  = MenuItem
  3490.       69  = SubItem
  3491.       75  = PropInfo   (made internally, for gadgets)
  3492.       81  = StringInfo (made internally, for gadgets)
  3493.       87  = Text Attr
  3494.  
  3495.  
  3496. Note: Window/Screen pointers are the pointers returned by Intuition
  3497.       OpenWindow/OpenScreen functions, and do not have the above format.
  3498.  
  3499.                 ARexx Programmers Intuition & Graphics Library
  3500.                           ( version 1.1  09/21/91 )
  3501.  
  3502.  
  3503.  
  3504.   Given the above, a new function has been added to allow hard coding of
  3505.   structures.
  3506.  
  3507.  
  3508. <>  MAKESTRUCT(owner,type,size,memtype)
  3509.     MAKEPOINTER - synonymous with MAKESTRUCT
  3510.  
  3511.       Allocate a null structure/memory block.
  3512.  
  3513.       Inputs:
  3514.       
  3515.           owner      - pointer to object which will own this structure.
  3516.                        See description of MAKEBOOLGAGET.
  3517.           
  3518.           type       - numeric, type as specified above
  3519.                        The size allocated is implicit in the type
  3520.                        you specify.
  3521.  
  3522.           size       - numeric, size of mem block to allocate
  3523.                        APIG uses 'type' to determine the amount
  3524.                        of memory to allocate. If 'size' is non-zero
  3525.                        then it specifies an extra number of bytes
  3526.                        to be allocated in addition to the standard
  3527.                        structure size.
  3528.           
  3529.           memtype    - 4byte hex-string, memory type to allocate
  3530.                        (MEMF_CHIP/MEMF_CLEAR/MEMF_FAST/MEMF_PUBLIC)
  3531.           
  3532.      Returns:        - pointer to allocated structure as a rexx hex string.
  3533.                      - returns null ('0000 0000'x) if call fails
  3534.  
  3535.  
  3536.      eg.  allocate memory for a gadget structure
  3537.  
  3538.           mygad = allocstruct(0,15,0,MEMF_CLEAR)
  3539.  
  3540.           returns an APIG pointer, formatted as above with negative offset
  3541.           values, to a null memory block the size of a Gadget structure.
  3542.  
  3543.           The 'owner' is 0, indicating an independent structure which must
  3544.           be explicitly freed (using FREETHIS()).  You could make 'owner'
  3545.           a window, so that when the window is closed the memory is 
  3546.           freed.
  3547.  
  3548.           Note the 'size' parm is 0, type 15 tells APIG how much memory
  3549.           to allocate.  If 'size' were non-zero then APIG would allocate
  3550.           the standard structure size + 'size' bytes.
  3551.  
  3552.           ie.  mygad = allocstruct(0,15,30,MEMF_CLEAR) would allocate
  3553.                an additional 30 bytes, along with the 'standard' size of
  3554.                a Gadget structure.
  3555.  
  3556.  
  3557.      eg.  allocate a block of memory
  3558.  
  3559.           mymem = allocstruct(0,0,400,MEMF_CLEAR)
  3560.           or
  3561.           mymem = allocpointer(0,0,400,MEMF_CLEAR)
  3562.  
  3563.           'owner' is zero, so must be freed explicitly
  3564.           'type'  is zero, thus ...
  3565.           'size'  determines total amount of memory to actually allocate
  3566.          
  3567.     After allocating the structure SETVALUE can then be used to assign
  3568.     values to the structures data fields.
  3569.  
  3570.                 ARexx Programmers Intuition & Graphics Library
  3571.                           ( version 1.1  09/21/91 )
  3572.  
  3573.  
  3574.  
  3575.     If you were hard coding an image structure you might do the
  3576.     following:
  3577.  
  3578.  
  3579.     image = makestruct(0,51,0,MEMF_CLEAR)
  3580.  
  3581.  
  3582.     imagedata = makepointer(image,0,72,MEMF_CHIP)
  3583.  
  3584.     (note imagedata is just a block of mem, 'owned' by 'image',
  3585.           thus when 'image' is freed so is the imagedata block)
  3586.  
  3587.  
  3588.     x = setvalue(image,0,2,'n',0,0)            /* left edge   */
  3589.     x = setvalue(image,2,2,'n',0,0)            /* top edge    */
  3590.     x = setvalue(image,4,2,'n',16,0)           /* width       */
  3591.     x = setvalue(image,6,2,'n',9,0)            /* height      */
  3592.     x = setvalue(image,8,2,'n',4,0)            /* depth       */
  3593.     x = setvalue(image,10,4,'p',imagedata,0)   /* imagedata   */
  3594.     x = setvalue(image,14,1,'n',255,0)         /* planepick   */ 
  3595.     x = setvalue(image,15,1,'n',255,0)         /* planeonoff  */
  3596.     x = setvalue(image,16,4,'p',0,0)           /* next image  */
  3597.  
  3598.     Assuming, of course you have stuffed some data into imagedata, 
  3599.     the 'image' pointer can now be used with the DrawImage() function.
  3600.  
  3601.     If the ALLOCMEM() function had been used to allocate the block
  3602.     then used in DrawImage(), DrawImage would have found the pointer
  3603.     to be invalid and simply would have returned (failed).
  3604.  
  3605.  
  3606.                 ARexx Programmers Intuition & Graphics Library
  3607.                           ( version 1.1  09/21/91 )
  3608.  
  3609.  
  3610.   The 'bmhdr' pointer points to the following structure:
  3611.  
  3612.  
  3613.   STRUCTURE   iffinfoblock,0       
  3614.   
  3615.        UWORD  iffviewmode              ; offset 0, View Modes for the IFF
  3616.        
  3617.        UWORD  iffcolors                ; offset +2, number of colors
  3618.        
  3619.        STRUCT bmheader,SIZEOF_bmhd     
  3620.                                        ; BitMapHeader Info from the IFF file
  3621.                                        ; as shown below
  3622.        
  3623.        STRUCT cmheader,128             ; offset +24
  3624.                                        ; ColorMap Info from the IFF file
  3625.                                        ; max 64 colors @ 2bytes per color
  3626.        
  3627.  
  3628.   -------------------------
  3629.  
  3630.   STRUCTURE BitMapHeader,0             
  3631.        UWORD bmh_Width                 ; offset +4 from bmhdr pointer 
  3632.        UWORD bmh_Height                ; offset +6
  3633.        WORD  bmh_XPos                  ; offset +8
  3634.        WORD  bmh_YPos                  ; offset +10
  3635.        UBYTE bmh_nPlanes               ; offset +12
  3636.        UBYTE bmh_Masking               ; offset +13
  3637.        UBYTE bmh_Compression           ; offset +14
  3638.        UBYTE bmh_Pad1                  ; offset +15
  3639.        UWORD bmh_TranspCol             ; offset +16
  3640.        UBYTE bmh_XAspect               ; offset +18
  3641.        UBYTE bmh_YAspect               ; offset +19
  3642.        WORD  bmh_PageWidth             ; offset +20
  3643.        WORD  bmh_PageHeight            ; offset +22
  3644.  
  3645.  
  3646.   eg. what APIG effectively does to obtain the width of an IFF pic.
  3647.  
  3648.       bmhdr = getvalue(pic,-12,4,'p')
  3649.       width = getvalue(bmhdr,4,2,'n')
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.                               --- THE END ---
  3657.